laozt 1 year ago
commit 72c623ad11

@ -4,6 +4,7 @@ package com.ruoyi.programManagement.controller;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.programManagement.entity.BPlanEnterprise; import com.ruoyi.programManagement.entity.BPlanEnterprise;
import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest; import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest;
@ -27,6 +28,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.Arrays;
import java.util.List; import java.util.List;
/** /**
@ -125,14 +127,14 @@ public class BPlanEnterpriseController extends BaseController {
/** /**
* *
* *
* @param bPlanEnterprise * @param req
* @return * @return
*/ */
@PutMapping @PutMapping
@ApiOperation(value = "修改计划企业表") @ApiOperation(value = "修改计划企业表")
public AjaxResult update(@RequestBody BPlanEnterpriseRequest bPlanEnterprise) { public AjaxResult update(@RequestBody BPlanEnterpriseRequest req) {
bPlanEnterpriseService.updatePlan(req);
return success(bPlanEnterpriseService.updateById(bPlanEnterprise)); return success();
} }
/** /**
@ -197,9 +199,10 @@ public class BPlanEnterpriseController extends BaseController {
/** /**
* *
*/ */
@ApiOperation(value = "查看计划明细") @ApiOperation(value = "批量更新状态")
@PostMapping("/updateIdList") @GetMapping("/updateIdList")
public AjaxResult updateIdList(String[] idList) { public AjaxResult updateIdList(@RequestParam("idListStr") String idListStr) {
List<String> idList = Arrays.asList(idListStr.split(","));
bPlanEnterpriseService.updateIdList(idList); bPlanEnterpriseService.updateIdList(idList);
return AjaxResult.success(); return AjaxResult.success();
} }

@ -114,6 +114,9 @@ public class BPlanEnterprise extends BaseEntity {
@ApiModelProperty(value = "计划月份") @ApiModelProperty(value = "计划月份")
private String[] plannedMonth; private String[] plannedMonth;
@TableField(javaType = true)
private String plannedMonthStr;
/** /**
* *

@ -14,7 +14,7 @@ import java.util.List;
* @author wu * @author wu
* @since 2023-09-07 09:43:06 * @since 2023-09-07 09:43:06
*/ */
public interface BPlanEnterpriseMapper extends BaseMapper<BPlanEnterpriseRequest> { public interface BPlanEnterpriseMapper extends BaseMapper<BPlanEnterprise> {
/** /**
@ -104,7 +104,7 @@ public interface BPlanEnterpriseMapper extends BaseMapper<BPlanEnterpriseRequest
* *
* @param idList * @param idList
*/ */
void updateIdList(String[] idList); void updateIdList(List<String> idList);
/** /**
@ -113,5 +113,12 @@ public interface BPlanEnterpriseMapper extends BaseMapper<BPlanEnterpriseRequest
*/ */
void insertPlan(BPlanEnterpriseRequest bPlanEnterprise); void insertPlan(BPlanEnterpriseRequest bPlanEnterprise);
/**
*
* @param bPlanEnterprise
*/
void updatePlan(BPlanEnterpriseRequest bPlanEnterprise);
} }

@ -17,7 +17,7 @@ import java.util.Map;
* @author wu * @author wu
* @since 2023-09-07 09:43:06 * @since 2023-09-07 09:43:06
*/ */
public interface BPlanEnterpriseService extends IService<BPlanEnterpriseRequest> { public interface BPlanEnterpriseService extends IService<BPlanEnterprise> {
@ -99,7 +99,7 @@ public interface BPlanEnterpriseService extends IService<BPlanEnterpriseRequest>
* *
* @param idList * @param idList
*/ */
void updateIdList(String[] idList); void updateIdList(List<String> idList);
/** /**
@ -107,5 +107,11 @@ public interface BPlanEnterpriseService extends IService<BPlanEnterpriseRequest>
* @param bPlanEnterprise * @param bPlanEnterprise
*/ */
void insert(BPlanEnterpriseRequest bPlanEnterprise); void insert(BPlanEnterpriseRequest bPlanEnterprise);
/**
*
* @param bPlanEnterprise
*/
void updatePlan(BPlanEnterpriseRequest bPlanEnterprise);
} }

@ -23,7 +23,7 @@ import java.util.Map;
* @since 2023-09-07 09:43:07 * @since 2023-09-07 09:43:07
*/ */
@Service("bPlanEnterpriseService") @Service("bPlanEnterpriseService")
public class BPlanEnterpriseServiceImpl extends ServiceImpl<BPlanEnterpriseMapper, BPlanEnterpriseRequest> implements BPlanEnterpriseService { public class BPlanEnterpriseServiceImpl extends ServiceImpl<BPlanEnterpriseMapper, BPlanEnterprise> implements BPlanEnterpriseService {
@Resource @Resource
private BPlanEnterpriseMapper bPlanEnterpriseMapper; private BPlanEnterpriseMapper bPlanEnterpriseMapper;
@ -102,7 +102,7 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl<BPlanEnterpriseMappe
} }
@Override @Override
public void updateIdList(String[] idList) { public void updateIdList(List<String> idList) {
bPlanEnterpriseMapper.updateIdList(idList); bPlanEnterpriseMapper.updateIdList(idList);
} }
@ -111,6 +111,11 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl<BPlanEnterpriseMappe
bPlanEnterpriseMapper.insertPlan(bPlanEnterprise); bPlanEnterpriseMapper.insertPlan(bPlanEnterprise);
} }
@Override
public void updatePlan(BPlanEnterpriseRequest bPlanEnterprise) {
bPlanEnterpriseMapper.updatePlan(bPlanEnterprise);
}
} }

@ -317,17 +317,44 @@
</select> </select>
<update id="updateIdList"> <update id="updateIdList" parameterType="java.util.List">
UPDATE b_plan_enterprise UPDATE b_plan_enterprise
SET status = 1 SET status = 1
WHERE id in WHERE id in
<foreach item="item" collection="idList" open="(" separator="," close=")"> <foreach item="item" collection="list" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</update>
<update id="updatePlan" parameterType="BPlanEnterpriseRequest">
update b_plan_enterprise
<trim prefix="SET" suffixOverrides=",">
<if test="enterpriseId != null">enterprise_id=#{enterpriseId},</if>
<if test="district != null">district=#{district},</if>
<if test="plannedYear != null">planned_year={plannedYear},</if>
<if test="isPoint != null">is_point=#{isPoint},</if>
<if test="enterpriseName != null">enterprise_name=#{enterpriseName},</if>
<if test="lawSort != null">law_sort=#{law_sort},</if>
<if test="lawAreas != null">law_areas=#{lawAreas},</if>
<if test="lawLevel != null">law_level=#{lawLevel},</if>
<if test="lawHierarchy != null">law_hierarchy=#{lawHierarchy},</if>
<if test="plannedMonth != null">planned_month=#{plannedMonth},</if>
<if test="status != null">status=#{status},</if>
<if test="createId != null">create_id=#{createId},</if>
<if test="createBy != null">create_by=#{createBy},</if>
<if test="createTime != null">create_time=#{createTime},</if>
<if test="updateId != null">update_id=#{updateId},</if>
<if test="updateBy != null">update_by=#{updateBy},</if>
<if test="updateTime != null">update_time=#{updateTime},</if>
<if test="remark != null">remark=#{remark},</if>
<if test="userId != null">user_id=#{userId},</if>
<if test="deptId != null">dept_id=#{deptId},</if>
</trim>
where id = #{id}
</update> </update>
<insert id="insertPlan" parameterType="BPlanEnterpriseRequest" useGeneratedKeys="true" keyProperty="id"> <insert id="insertPlan" parameterType="BPlanEnterpriseRequest" useGeneratedKeys="true" keyProperty="id">
insert into b_plan_enterprise insert into b_plan_enterprise
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">

Loading…
Cancel
Save