|
|
|
@ -4,7 +4,6 @@ import cn.hutool.core.date.DatePattern;
|
|
|
|
|
import com.alibaba.excel.util.CollectionUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
import com.hnac.hzims.common.logs.utils.StringUtils; |
|
|
|
|
import com.hnac.hzims.safeproduct.constants.SafeProductConstant; |
|
|
|
|
import com.hnac.hzims.safeproduct.entity.ConferencePlanEntity; |
|
|
|
|
import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity; |
|
|
|
@ -12,6 +11,7 @@ import com.hnac.hzims.safeproduct.enums.RehearsalStatusEnum;
|
|
|
|
|
import com.hnac.hzims.safeproduct.mapper.ConferencePlanMapper; |
|
|
|
|
import com.hnac.hzims.safeproduct.mapper.ConferenceRecordMapper; |
|
|
|
|
import com.hnac.hzims.safeproduct.service.IConferenceRecordService; |
|
|
|
|
import com.hnac.hzims.safeproduct.utils.BaseUtil; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
@ -59,21 +59,7 @@ public class ConferenceRecordServiceImpl extends ServiceImpl<ConferenceRecordMap
|
|
|
|
|
// 查询是否存在同月编号
|
|
|
|
|
String lastCode = getLastCode(currentMonth); |
|
|
|
|
// 若不存在,新增编号
|
|
|
|
|
String code; |
|
|
|
|
if (StringUtils.isNull(lastCode)) { |
|
|
|
|
code = "HYJL" + currentMonth + "001"; |
|
|
|
|
} else { // 若存在,编号递增
|
|
|
|
|
String oldNum = lastCode.substring(lastCode.length() - 3); |
|
|
|
|
int value = Integer.parseInt(oldNum) + 1; |
|
|
|
|
// 根据数位拼接编号
|
|
|
|
|
if (value < 10) { |
|
|
|
|
code = "HYJL" + currentMonth + "00" + value; |
|
|
|
|
} else if (value < 100) { |
|
|
|
|
code = "HYJL" + currentMonth + "0" + value; |
|
|
|
|
} else { |
|
|
|
|
code = "HYJL" + currentMonth + value; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
String code = BaseUtil.getUniqueCode("HYJL", lastCode, currentMonth); |
|
|
|
|
conferenceRecord.setCode(code); |
|
|
|
|
boolean save = this.save(conferenceRecord); |
|
|
|
|
// 若会议记录新增成功,修改会议计划状态为已完成
|
|
|
|
|