人员,工资卡,合同优化修改

This commit is contained in:
方亮 2025-08-16 13:42:12 +08:00
parent 8cba94bc50
commit a1af8ab99c
6 changed files with 21 additions and 19 deletions

View File

@ -109,14 +109,17 @@ public class PmWorkerController extends BaseController {
@SysLog(title = "人员入场管理", businessType = OperaType.UPDATE, logType = 0, module = "施工人员->出入场管理->人员入场管理", details = "修改人员入场") @SysLog(title = "人员入场管理", businessType = OperaType.UPDATE, logType = 0, module = "施工人员->出入场管理->人员入场管理", details = "修改人员入场")
public AjaxResult edit(@RequestParam(value = "files",required = false) MultipartFile[] files,@RequestParam(value = "fileMsg",required = false) String fileMsg, @RequestParam(value = "params")String params) { public AjaxResult edit(@RequestParam(value = "files",required = false) MultipartFile[] files,@RequestParam(value = "fileMsg",required = false) String fileMsg, @RequestParam(value = "params")String params) {
try { try {
List<WebFileDto> listFile = FastJsonHelper.jsonArrStrToBeanList(fileMsg, WebFileDto.class); List<WebFileDto> listFile = new ArrayList<>();
// 验证对应关系 if(files != null && files.length > 0){
if (listFile.size() != files.length) { listFile = FastJsonHelper.jsonArrStrToBeanList(fileMsg, WebFileDto.class);
throw new IllegalArgumentException("文件信息与文件数量不匹配"); // 验证对应关系
} if (listFile.size() != files.length) {
//先将数据对应关系处理 throw new IllegalArgumentException("文件信息与文件数量不匹配");
for (int i = 0; i < listFile.size(); i++) { }
listFile.get(i).setFile(files[i]); //先将数据对应关系处理
for (int i = 0; i < listFile.size(); i++) {
listFile.get(i).setFile(files[i]);
}
} }
PmWorker o = FastJsonHelper.jsonStrToBean(params, PmWorker.class); PmWorker o = FastJsonHelper.jsonStrToBean(params, PmWorker.class);
return toAjax(service.updateByPrimaryKey(o,listFile)); return toAjax(service.updateByPrimaryKey(o,listFile));

View File

@ -43,9 +43,7 @@ public class BmWorkerWageCardServiceImpl implements BmWorkerWageCardService {
if(record.getDelIds() != null){ if(record.getDelIds() != null){
//修改时删除部分图片 //修改时删除部分图片
String[] split = record.getDelIds().split(","); String[] split = record.getDelIds().split(",");
for (String s : split) { fileUploadUtils.delFileList(split,null,null, null);
fileUploadUtils.delFileListById(s,"",Constants.FILE_UPLOAD_WAGE_CARD, "");
}
} }
if(!listFile.isEmpty()){ if(!listFile.isEmpty()){
//组装数据 //组装数据

View File

@ -121,6 +121,7 @@ public class PmWorkerServiceImpl implements PmWorkerService{
BmWorkerWageCard wageCard = new BmWorkerWageCard(); BmWorkerWageCard wageCard = new BmWorkerWageCard();
wageCard.setWorkerId(id); wageCard.setWorkerId(id);
BmWorkerWageCard bmWorkerWageCard = wageCardService.selectWageCardByWorkerId(wageCard); BmWorkerWageCard bmWorkerWageCard = wageCardService.selectWageCardByWorkerId(wageCard);
assert worker != null;
worker.setBmWorkerWageCard(bmWorkerWageCard); worker.setBmWorkerWageCard(bmWorkerWageCard);
if(worker.getEinStatus() == 1){ if(worker.getEinStatus() == 1){
//查询合同数据 只有入场才会有合同 //查询合同数据 只有入场才会有合同

View File

@ -198,7 +198,7 @@ public class FileUtilController {
return R.fail("资源表id不能为空"); return R.fail("资源表id不能为空");
} }
} }
Integer num= service.delFileListById( id,sourceId,sourceTable,sourceType); Integer num= service.delFileListById( id,sourceId,sourceType,sourceTable);
return R.ok(num); return R.ok(num);
} }
catch (Exception e) { catch (Exception e) {

View File

@ -270,7 +270,6 @@ public class FileUtilsServiceImpl {
*/ */
public Integer delFileList(String[] id, String[] sourceId, String[] sourceTable, String[] sourceType) { public Integer delFileList(String[] id, String[] sourceId, String[] sourceTable, String[] sourceType) {
List<UploadFileVo> list; List<UploadFileVo> list;
if(id!=null && id.length>0){ if(id!=null && id.length>0){
list=mapper.getFileListByIds(id); list=mapper.getFileListByIds(id);
int num= mapper.delFileList(id); int num= mapper.delFileList(id);

View File

@ -29,20 +29,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<update id="delFileListBySourceId"> <update id="delFileListBySourceId">
update bm_files set is_active=0 update bm_files set is_active = 0
<where> <where>
<if test="id!=null and id!=''">
and id=#{id}
</if>
<if test="sourceId !=null and sourceId!=''"> <if test="sourceId !=null and sourceId!=''">
and source_id=#{sourceId} and source_id=#{sourceId}
</if> </if>
<if test="sourceType !=null and sourceType!=''"> <if test="sourceType !=null and sourceType!=''">
and source_type=#{sourceType} and source_type= #{sourceType}
</if> </if>
<if test="sourceTable !=null and sourceTable!=''"> <if test="sourceTable !=null and sourceTable!=''">
and source_table=#{sourceTable} and source_table= #{sourceTable}
</if> </if>
<if test="id !=null and id!=''">
and id= #{id}
</if>
</where> </where>
</update> </update>