Commit db18a29c by MMF

MMF 2026-03-26 修改集输专业团队应急项目人员自选功能

parent 1dd21582
......@@ -57,7 +57,7 @@ public class ZqczPftbController extends BaseController {
* 导出
*/
@PostMapping("/export")
public void export(HttpServletResponse response, ZqczPftbQuery zqczPftbQuery) {
public void export(HttpServletResponse response, @RequestBody ZqczPftbQuery zqczPftbQuery) {
zqczPftbService.export(response, zqczPftbQuery);
}
......
......@@ -44,4 +44,9 @@ public interface ZqczRyxxMapper {
* 批量插入
*/
int batchAdd(@Param("ryxxList") List<ZqczRyxx> ryxxList);
/**
* 根据人员名称查询人员分类
*/
List<ZqczRyxxVo> checkRyfl(@Param("rymcList") List<String> rymcList);
}
......@@ -77,7 +77,7 @@ public class ZqczXmRyLsjlController extends BaseController {
* 现场抽取情况统计
*/
@GetMapping("/spotCheckStatus")
public AjaxResult spotCheckStatus(ZqczXmRyLsjlQuery zqczXmRyLsjlQuery){
public AjaxResult spotCheckStatus(ZqczXmRyLsjlQuery zqczXmRyLsjlQuery) {
try {
return success(zqczXmRyLsjlService.spotCheckStatus(zqczXmRyLsjlQuery));
} catch (BusinessException e) {
......@@ -96,4 +96,20 @@ public class ZqczXmRyLsjlController extends BaseController {
public void spotCheckStatusExport(HttpServletResponse response, @RequestBody ZqczXmRyLsjlQuery zqczXmRyLsjlQuery) {
zqczXmRyLsjlService.spotCheckStatusExport(response, zqczXmRyLsjlQuery);
}
/**
* 修改盲抽人员名称
*/
@PutMapping("/editRymc")
public AjaxResult editRymc(@RequestBody ZqczXmRyLsjl zqczXmRyLsjl) {
try {
return toAjax(zqczXmRyLsjlService.editRymc(zqczXmRyLsjl));
} catch (BusinessException e) {
log.warn("最强操作-盲抽人员名称修改失败" + e.getMessage());
return warn(e.getMessage());
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
}
......@@ -76,4 +76,9 @@ public class ZqczXmRyLsjlVo implements Serializable {
*/
@Excel(name = "盲抽项目名称")
private String xmmc;
/**
* 项目专业
*/
private String xmzy;
}
......@@ -33,4 +33,9 @@ public interface ZqczXmRyLsjlService {
* 现场抽取情况表导出
*/
void spotCheckStatusExport(HttpServletResponse response, ZqczXmRyLsjlQuery zqczXmRyLsjlQuery);
/**
* 修改盲抽人员名称
*/
int editRymc(ZqczXmRyLsjl zqczXmRyLsjl);
}
......@@ -7,6 +7,7 @@ import com.qianhe.common.exception.BusinessException;
import com.qianhe.common.utils.MtTimeUtil;
import com.qianhe.common.utils.MtUtils;
import com.qianhe.common.utils.SecurityUtils;
import com.qianhe.common.utils.StringUtils;
import com.qianhe.zqcz.pwxx.domain.ZqczPwxxQuery;
import com.qianhe.zqcz.pwxx.domain.ZqczPwxxVo;
import com.qianhe.zqcz.pwxx.mapper.ZqczPwxxMapper;
......@@ -312,6 +313,56 @@ public class ZqczXmRyLsjlServiceImpl implements ZqczXmRyLsjlService {
}
/**
* 修改盲抽人员名称
*/
@Override
public int editRymc(ZqczXmRyLsjl zqczXmRyLsjl) {
if (zqczXmRyLsjl.getXmryid() == null) {
throw new BusinessException("项目人员ID不能为空");
}
if (StringUtils.isEmpty(zqczXmRyLsjl.getRymc())) {
throw new BusinessException("盲抽人员姓名不能为空");
}
ZqczXmRyLsjlVo zqczXmRyLsjlVo = zqczXmRyLsjlMapper.info(zqczXmRyLsjl.getXmryid());
boolean xmztFlag = ZqczXmzyEnum.JISHU_ZHUANYE.getCode().equals(zqczXmRyLsjlVo.getXmzy());
boolean xmlbFlag = ZqczXmlbEnum.TUANDUI_YINGJI.getCode().equals(zqczXmRyLsjlVo.getXmlb());
if (xmztFlag && xmlbFlag) { // 只有是集输专业并且项目类别是团队应急时才能修改
List<String> oldRymcList = Arrays.asList(zqczXmRyLsjlVo.getRymc().trim().split(",")); // 之前存储的盲抽人员
List<String> newRymcList = Arrays.stream(zqczXmRyLsjl.getRymc().split(",")).map(String::trim).filter(s -> !s.isEmpty()).collect(Collectors.toList()); // 现在修改的盲抽人员
List<String> addRymcList = newRymcList.stream().filter(item -> !oldRymcList.contains(item)).collect(Collectors.toList()); // 计算差值
if (!Optional.ofNullable(addRymcList).orElse(Collections.emptyList()).isEmpty()) {
List<ZqczRyxxVo> addRyxxList = zqczRyxxMapper.checkRyfl(addRymcList);
List<String> addRyflList = addRyxxList.stream().map(ZqczRyxxVo::getRyfl).distinct().collect(Collectors.toList());
String addRyflStr = String.join(",", addRyflList);
if (!ZqczRyflEnum.BANZHAN.getCode().equals(addRyflStr)) {
throw new BusinessException("只能新增班站人员");
}
}
List<String> delRymcList = oldRymcList.stream().filter(item -> !newRymcList.contains(item)).collect(Collectors.toList()); // 计算差值
if (!Optional.ofNullable(delRymcList).orElse(Collections.emptyList()).isEmpty()) {
List<ZqczRyxxVo> delRyxxList = zqczRyxxMapper.checkRyfl(delRymcList);
List<String> delRyflList = delRyxxList.stream().map(ZqczRyxxVo::getRyfl).distinct().collect(Collectors.toList());
String delRyflStr = String.join(",", delRyflList);
if (!ZqczRyflEnum.BANZHAN.getCode().equals(delRyflStr)) {
throw new BusinessException("只能删除班站人员");
}
}
List<ZqczRyxxVo> newRyxxList = zqczRyxxMapper.checkRyfl(newRymcList);
List<String> newDwmcList = newRyxxList.stream().map(ZqczRyxxVo::getDwmc).distinct().collect(Collectors.toList());
String addDwmcStr = String.join(",", newDwmcList);
return zqczXmRyLsjlMapper.edit(ZqczXmRyLsjl.builder().xmryid(zqczXmRyLsjl.getXmryid()).rymc(String.join(",", newRymcList)).dwmc(addDwmcStr).build());
} else {
throw new BusinessException("只有是集输专业并且项目类别是团队应急时才能修改");
}
}
/**
* 创建大标题
*/
private void createMainTitle(Workbook workbook, Sheet sheet, Integer lastCol) {
......
......@@ -144,4 +144,10 @@
</otherwise>
</choose>
</insert>
<select id="checkRyfl" resultMap="ZqczRyxxResult">
<include refid="selectCommon"></include> WHERE rymc IN
<foreach item="rymc" collection="rymcList" open="(" separator="," close=")">
#{rymc}
</foreach>
</select>
</mapper>
\ No newline at end of file
......@@ -10,6 +10,7 @@
<result property="jcrwid" column="JCRWID"/>
<result property="xmmc" column="XMMC"/>
<result property="xmlb" column="XMLB"/>
<result property="xmzy" column="XMZY"/>
<result property="rymc" column="RYMC"/>
<result property="dwmc" column="DWMC"/>
<result property="update_time" column="UPDATE_TIME"/>
......@@ -26,6 +27,7 @@
lsjl.RYMC,
lsjl.DWMC,
lsjl.JCDWID,
lsjl.XMZY,
jcdw.jcdwmc AS JCDWMC,
lsjl.UPDATE_TIME
FROM
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment