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..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 @@ -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; @@ -27,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; /** @@ -125,14 +127,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(); } /** @@ -197,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/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..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 @@ -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 { /** @@ -104,7 +104,7 @@ public interface BPlanEnterpriseMapper extends BaseMapper idList); /** @@ -113,5 +113,12 @@ public interface BPlanEnterpriseMapper extends BaseMapper { +public interface BPlanEnterpriseService extends IService { @@ -99,7 +99,7 @@ public interface BPlanEnterpriseService extends IService * 批量更新状态 * @param idList */ - void updateIdList(String[] idList); + void updateIdList(List idList); /** @@ -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..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 @@ -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; @@ -102,7 +102,7 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl idList) { bPlanEnterpriseMapper.updateIdList(idList); } @@ -111,6 +111,11 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl - + UPDATE b_plan_enterprise SET status = 1 WHERE id in - + #{item} + + + 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} + insert into b_plan_enterprise