From a01fb1b3f0a9cfaf0ed453119b850b5ff941ae9c Mon Sep 17 00:00:00 2001 From: dongdingding <207595406@qq.com> Date: Thu, 21 Dec 2023 17:29:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E4=BC=81=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BPlanEnterpriseController.java | 9 ++++--- .../entity/BPlanEnterprise.java | 3 +++ .../mapper/BPlanEnterpriseMapper.java | 9 ++++++- .../service/BPlanEnterpriseService.java | 8 +++++- .../impl/BPlanEnterpriseServiceImpl.java | 7 ++++- .../mapper/yingji/BPlanEnterpriseMapper.xml | 27 +++++++++++++++++++ 6 files changed, 56 insertions(+), 7 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java index ffe0312..18518be 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java @@ -4,6 +4,7 @@ package com.ruoyi.programManagement.controller; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.programManagement.entity.BPlanEnterprise; import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest; @@ -125,14 +126,14 @@ public class BPlanEnterpriseController extends BaseController { /** * 修改数据 * - * @param bPlanEnterprise 实体对象 + * @param req 实体对象 * @return 修改结果 */ @PutMapping @ApiOperation(value = "修改计划企业表") - public AjaxResult update(@RequestBody BPlanEnterpriseRequest bPlanEnterprise) { - - return success(bPlanEnterpriseService.updateById(bPlanEnterprise)); + public AjaxResult update(@RequestBody BPlanEnterpriseRequest req) { + bPlanEnterpriseService.updatePlan(req); + return success(); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/BPlanEnterprise.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/BPlanEnterprise.java index 6c14f35..d220540 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/BPlanEnterprise.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/BPlanEnterprise.java @@ -114,6 +114,9 @@ public class BPlanEnterprise extends BaseEntity { @ApiModelProperty(value = "计划月份") private String[] plannedMonth; + @TableField(javaType = true) + private String plannedMonthStr; + /** * 行政区划 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java index 6703d4c..5cecb3b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java @@ -14,7 +14,7 @@ import java.util.List; * @author wu * @since 2023-09-07 09:43:06 */ -public interface BPlanEnterpriseMapper extends BaseMapper { +public interface BPlanEnterpriseMapper extends BaseMapper { /** @@ -113,5 +113,12 @@ public interface BPlanEnterpriseMapper extends BaseMapper { +public interface BPlanEnterpriseService extends IService { @@ -107,5 +107,11 @@ public interface BPlanEnterpriseService extends IService * @param bPlanEnterprise */ void insert(BPlanEnterpriseRequest bPlanEnterprise); + + /** + * 新增 + * @param bPlanEnterprise + */ + void updatePlan(BPlanEnterpriseRequest bPlanEnterprise); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java index 6a5a68c..5da7f04 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java @@ -23,7 +23,7 @@ import java.util.Map; * @since 2023-09-07 09:43:07 */ @Service("bPlanEnterpriseService") -public class BPlanEnterpriseServiceImpl extends ServiceImpl implements BPlanEnterpriseService { +public class BPlanEnterpriseServiceImpl extends ServiceImpl implements BPlanEnterpriseService { @Resource private BPlanEnterpriseMapper bPlanEnterpriseMapper; @@ -111,6 +111,11 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl + + update b_plan_enterprise + + enterprise_id=#{enterpriseId}, + district=#{district}, + planned_year={plannedYear}, + is_point=#{isPoint}, + enterprise_name=#{enterpriseName}, + law_sort=#{law_sort}, + law_areas=#{lawAreas}, + law_level=#{lawLevel}, + law_hierarchy=#{lawHierarchy}, + planned_month=#{plannedMonth}, + status=#{status}, + create_id=#{createId}, + create_by=#{createBy}, + create_time=#{createTime}, + update_id=#{updateId}, + update_by=#{updateBy}, + update_time=#{updateTime}, + remark=#{remark}, + user_id=#{userId}, + dept_id=#{deptId}, + + where id = #{id} + + From d4344978c333c515b6652fb59c001c6be45772d1 Mon Sep 17 00:00:00 2001 From: dongdingding <207595406@qq.com> Date: Fri, 22 Dec 2023 09:22:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BPlanEnterpriseController.java | 8 +++++--- .../programManagement/mapper/BPlanEnterpriseMapper.java | 2 +- .../programManagement/service/BPlanEnterpriseService.java | 2 +- .../service/impl/BPlanEnterpriseServiceImpl.java | 2 +- .../resources/mapper/yingji/BPlanEnterpriseMapper.xml | 6 +++--- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java index 18518be..32a4918 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java @@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; +import java.util.Arrays; import java.util.List; /** @@ -198,9 +199,10 @@ public class BPlanEnterpriseController extends BaseController { /** * 批量更新状态 */ - @ApiOperation(value = "查看计划明细") - @PostMapping("/updateIdList") - public AjaxResult updateIdList(String[] idList) { + @ApiOperation(value = "批量更新状态") + @GetMapping("/updateIdList") + public AjaxResult updateIdList(@RequestParam("idListStr") String idListStr) { + List idList = Arrays.asList(idListStr.split(",")); bPlanEnterpriseService.updateIdList(idList); return AjaxResult.success(); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java index 5cecb3b..75c2bf0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java @@ -104,7 +104,7 @@ public interface BPlanEnterpriseMapper extends BaseMapper { * 批量更新状态 * @param idList */ - void updateIdList(String[] idList); + void updateIdList(List idList); /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/BPlanEnterpriseService.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/BPlanEnterpriseService.java index 6d50fc6..0721f74 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/BPlanEnterpriseService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/BPlanEnterpriseService.java @@ -99,7 +99,7 @@ public interface BPlanEnterpriseService extends IService { * 批量更新状态 * @param idList */ - void updateIdList(String[] idList); + void updateIdList(List idList); /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java index 5da7f04..7099d4a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java @@ -102,7 +102,7 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl idList) { bPlanEnterpriseMapper.updateIdList(idList); } diff --git a/ruoyi-system/src/main/resources/mapper/yingji/BPlanEnterpriseMapper.xml b/ruoyi-system/src/main/resources/mapper/yingji/BPlanEnterpriseMapper.xml index d8bc06d..bc031e4 100644 --- a/ruoyi-system/src/main/resources/mapper/yingji/BPlanEnterpriseMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/yingji/BPlanEnterpriseMapper.xml @@ -317,15 +317,15 @@ - + UPDATE b_plan_enterprise SET status = 1 WHERE id in - + #{item} - + update b_plan_enterprise