Commit 5a521427 by lijingjing

生成pdf逻辑修改;

parent 0818cf5d
......@@ -58,7 +58,7 @@ public class OriginalRecordController extends ServiceController {
@PostMapping("/pageVO")
public RestResult<Page<OriginalRecordVO>> getPageVO(OriginalRecordVO originalRecordVO) {
// 数据检测只能当前人看
if(StringUtils.isNotBlank(originalRecordVO.getSource()) && "test".equalsIgnoreCase(originalRecordVO.getSource())) {
if("TEST".equalsIgnoreCase(originalRecordVO.getSource())) {
originalRecordVO.setTesterId(getAccount().getUserId());
}
return success(originalRecordService.pageVO(getPage(), originalRecordVO));
......
......@@ -4,9 +4,7 @@ import com.baomidou.mybatisplus.mapper.Condition;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.toolkit.ArrayUtils;
import com.baomidou.mybatisplus.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.toolkit.StringUtils;
import com.patzn.cloud.commons.api.RestAssert;
import com.patzn.cloud.commons.controller.Account;
import com.patzn.cloud.commons.service.impl.BaseServiceImpl;
......@@ -243,7 +241,8 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
EntrustReportStatusEnum reportStatusEnum = EntrustFlowUtils.getReportStatus(toFlowStatus);
// 若从批准往后提交,则生成报告
if (fromFlowStatus == EntrustFlowEnum.REPORT_ALLOW) {
// change : 下一步是签发或者发放时,生成pdf
if (toFlowStatus == EntrustFlowEnum.REPORT_ISSUE || toFlowStatus == EntrustFlowEnum.REPORT_SEND) {
//转化PDF
executor1.execute(() -> changeExcelReportToPdf(ids));
}
......
......@@ -139,8 +139,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
public void initSampleCode(EntrustSample sample) {
// 样品类型
String category = sample.getCategory();
// 样品类型\名称
String category = sample.getCategory(), sampleName = sample.getName();
RestAssert.fail(StringUtils.isBlank(category), "样品类型不能为空");
String parentCategory = "";
if (StringUtils.isNotBlank(category)) {
......@@ -149,6 +149,11 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
parentCategory = chemicalCategory.getName();
}
// 判断槽号不能为空
if ("散样".equals(parentCategory)) {
RestAssert.fail(StringUtils.isBlank(sample.getSlotNo()), "样品槽号为空");
}
Account account = LoginHelper.getAccount();
int codeTypeNo = 0;
List<SysOrg> orgList = sysOrgClient.getListByUserId(account.getUserId()).getData();
......@@ -170,7 +175,13 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
codeType = CodeTypeEnum.SAMPLE_YFL_CODE;
break;
case "散样":
codeType = CodeTypeEnum.BULK_SAMPLE_CODE;
if ("原铝散样".equals(sampleName)) {
codeType = CodeTypeEnum.AL_BULK_SAMPLE_CODE;
} else if ("原铝重取".equals(sampleName)) {
codeType = CodeTypeEnum.AL_RETAKE_SAMPLE_CODE;
} else if ("电解质散样".equals(sampleName)) {
codeType = CodeTypeEnum.ELECT_BULK_SAMPLE_CODE;
}
break;
default:
codeType = CodeTypeEnum.SAMPLE_CODE;
......@@ -207,10 +218,9 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
thirdCode = sampleCode.replace("A", "C").replace(replaceStr, "HY");
sampleCode = sampleCode.replace(replaceStr, inspectNo);
}
// 散样样品编号处理
else if (CodeTypeEnum.BULK_SAMPLE_CODE == codeType) {
// 原铝散样样品编号处理
else if (CodeTypeEnum.AL_BULK_SAMPLE_CODE == codeType) {
// 替换槽号CH
RestAssert.fail(StringUtils.isBlank(sample.getSlotNo()), "样品槽号为空");
sampleCode = sampleCode.replace("CH", sample.getSlotNo());
// 根据当前系统时间获取班次
LocalTime now = LocalTime.now();
......@@ -228,6 +238,16 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
// 替换班次BC
sampleCode = sampleCode.replace("BC", clazz);
}
// 电解质散样样品编号处理
else if (CodeTypeEnum.ELECT_BULK_SAMPLE_CODE == codeType) {
// 替换槽号CH
sampleCode = sampleCode.replace("CH", sample.getSlotNo());
}
//原铝重取样品编号处理
else if (CodeTypeEnum.AL_RETAKE_SAMPLE_CODE == codeType) {
// 替换槽号CH
sampleCode = sampleCode.replace("CH", sample.getSlotNo());
}
}
if (StringUtils.isNotBlank(sampleCode)) {
......
......@@ -44,7 +44,7 @@
FROM entrust_sample
WHERE deleted = 0
AND entrust_id = #{entrustId}
ORDER BY code DESC
ORDER BY order_by asc
</select>
<select id="selectEntrustSampleReceive" resultType="com.patzn.cloud.service.hmhj.vo.EntrustVO">
......@@ -126,7 +126,7 @@
<if test="null != vo.uid">
AND e.uid = #{vo.uid}
</if>
order by e.entrust_time desc
order by e.ctime DESC
</select>
<!--查询委托历史数据-->
......
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