Commit 4bc79874 by wangweidong

Merge remote-tracking branch 'origin/master'

parents e4e641c2 65a718d2
...@@ -332,6 +332,12 @@ public class EntrustController extends ServiceController { ...@@ -332,6 +332,12 @@ public class EntrustController extends ServiceController {
return success(entrustService.registerSubmitToMake(ids, getAccount())); return success(entrustService.registerSubmitToMake(ids, getAccount()));
} }
@ApiOperation("提交修改审批申请")
@PostMapping("/submit_update_apply")
public RestResult<Boolean> submitUpdateApply(@RequestParam("id") Long id, String reason) {
return success(entrustService.submitUpdateApply(id, reason, getAccount()));
}
@ApiOperation("复制委托信息") @ApiOperation("复制委托信息")
@PostMapping("/clone_entrust") @PostMapping("/clone_entrust")
public RestResult<Boolean> clone(@RequestParam("ids") Long[] ids) { public RestResult<Boolean> clone(@RequestParam("ids") Long[] ids) {
......
...@@ -82,4 +82,6 @@ public interface IEntrustService extends IBaseService<Entrust> { ...@@ -82,4 +82,6 @@ public interface IEntrustService extends IBaseService<Entrust> {
boolean backFromMake(Long[] ids, Account account, String reason); boolean backFromMake(Long[] ids, Account account, String reason);
boolean backFromReceive(Long[] ids, Account account, String reason); boolean backFromReceive(Long[] ids, Account account, String reason);
boolean submitUpdateApply(Long id, String reason, Account account);
} }
...@@ -99,6 +99,9 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp ...@@ -99,6 +99,9 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
prepare.setId(null); prepare.setId(null);
savePrepare.add(prepare); savePrepare.add(prepare);
sampleIdsList.add(vo.getEntrustSampleId()); sampleIdsList.add(vo.getEntrustSampleId());
// 主要用来修改委托的复合型检测信息
EntrustSample entrustSample = vo.convert(EntrustSample.class);
entrustSampleService.updateById(entrustSample);
}else if ("备样".equalsIgnoreCase(vo.getMakeType())){ }else if ("备样".equalsIgnoreCase(vo.getMakeType())){
EntrustSampleBackup backup = new EntrustSampleBackup(); EntrustSampleBackup backup = new EntrustSampleBackup();
backup.setEntrustId(vo.getEntrustId()); backup.setEntrustId(vo.getEntrustId());
......
...@@ -1142,16 +1142,21 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe ...@@ -1142,16 +1142,21 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
BeanUtils.copyProperties(sourceSample, updateSample); BeanUtils.copyProperties(sourceSample, updateSample);
BeanUtils.copyProperties(entrustSample, updateSample, true); BeanUtils.copyProperties(entrustSample, updateSample, true);
updateById(updateSample); updateById(updateSample);
String sampleShape = null == entrustSample.getSampleShape() ? "" : entrustSample.getSampleShape(); String sampleShape = entrustSample.getSampleShape();
String sampleFrom = null == entrustSample.getSampleFrom() ? "" : entrustSample.getSampleFrom(); String sampleFrom = entrustSample.getSampleFrom();
Integer complianceTest = entrustSample.getComplianceTest();
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
String remark = ""; String remark = "";
if (!sourceSample.getSampleShape().equals(sampleShape)) { if (StringUtils.isNotBlank(sampleShape) && !sourceSample.getSampleShape().equals(sampleShape)) {
sb.append(String.format("样品状态:由【%s】 修改为 【%s】,", sourceSample.getSampleShape(), sampleShape)); sb.append(String.format("样品状态:由【%s】 修改为 【%s】,", sourceSample.getSampleShape(), sampleShape));
} }
if (!sourceSample.getSampleFrom().equals(sampleFrom)) { if (StringUtils.isNotBlank(sampleFrom) && !sourceSample.getSampleFrom().equals(sampleFrom)) {
sb.append(String.format("样品来源:由【%s】 修改为 【%s】,", sourceSample.getSampleFrom(), sampleFrom)); sb.append(String.format("样品来源:由【%s】 修改为 【%s】,", sourceSample.getSampleFrom(), sampleFrom));
} }
if (null != complianceTest && sourceSample.getComplianceTest() != complianceTest) {
sb.append(String.format("现场见证:由【%s】 修改为 【%s】,", sourceSample.getComplianceTest(), complianceTest));
}
if (sb.length() > 0) { if (sb.length() > 0) {
remark = sb.substring(0, sb.length() - 1); remark = sb.substring(0, sb.length() - 1);
......
...@@ -1154,6 +1154,13 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> ...@@ -1154,6 +1154,13 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
return true; return true;
} }
@Override
public boolean submitUpdateApply(Long id, String reason, Account account) {
RestAssert.fail(null == id || 0 == id.longValue(), "请选择要申请修改的委托");
Entrust entrust = getById(id);
return true;
}
private List<EntrustSampleDTO> listSampleDTOByType(Long entrustId, int type) { private List<EntrustSampleDTO> listSampleDTOByType(Long entrustId, int type) {
List<EntrustSampleDTO> sampleDTOList = baseMapper.listByContractId(entrustId); List<EntrustSampleDTO> sampleDTOList = baseMapper.listByContractId(entrustId);
return sampleDTOList.stream().filter(t -> (null == t.getType() ? 0 : t.getType().intValue()) == type).collect(Collectors.toList()); return sampleDTOList.stream().filter(t -> (null == t.getType() ? 0 : t.getType().intValue()) == type).collect(Collectors.toList());
......
...@@ -91,7 +91,9 @@ ...@@ -91,7 +91,9 @@
</if> </if>
) )
SELECT i.*,s.name AS "sampleName",e.test_side "testSide",s.code AS "sampleCode",l.record_id,r.object_key AS "recordObjectKey" FROM i SELECT i.*,s.name AS "sampleName",e.test_side "testSide",s.code AS "sampleCode",l.record_id,r.object_key AS "recordObjectKey",
s.compliance_test
FROM i
JOIN entrust_sample s ON i.entrust_sample_id = s.id JOIN entrust_sample s ON i.entrust_sample_id = s.id
LEFT JOIN ( SELECT id,item_id,record_id FROM item_rel_original_record WHERE deleted = 0 ) l ON i.id = l.item_id LEFT JOIN ( SELECT id,item_id,record_id FROM item_rel_original_record WHERE deleted = 0 ) l ON i.id = l.item_id
LEFT JOIN ( SELECT id,object_key FROM original_record WHERE deleted = 0 ) r ON l.record_id = r.id LEFT JOIN ( SELECT id,object_key FROM original_record WHERE deleted = 0 ) r ON l.record_id = r.id
...@@ -156,7 +158,8 @@ ...@@ -156,7 +158,8 @@
</if> </if>
) )
SELECT i.*,s.name AS "sampleName",s.code AS "sampleCode",e.test_side "testSide",l.record_id,r.object_key AS "recordObjectKey" SELECT i.*,s.name AS "sampleName",s.code AS "sampleCode",e.test_side "testSide",l.record_id,r.object_key AS "recordObjectKey",
s.compliance_test
FROM i FROM i
JOIN entrust_sample s ON i.entrust_sample_id = s.id JOIN entrust_sample s ON i.entrust_sample_id = s.id
JOIN (select t.id,t.code,t.test_side from entrust t where t.deleted = 0 ) e on s.entrust_id = e.id JOIN (select t.id,t.code,t.test_side from entrust t where t.deleted = 0 ) e on s.entrust_id = e.id
......
...@@ -6,8 +6,7 @@ ...@@ -6,8 +6,7 @@
SELECT SELECT
p.id, p.entrust_sample_id,s.code,s.name,s.product_code,s.product_basis_name,s.compose_judge,s.product_standard_id,s.name_code, p.id, p.entrust_sample_id,s.code,s.name,s.product_code,s.product_basis_name,s.compose_judge,s.product_standard_id,s.name_code,
s.compliance_test,p.group_id,p.group_name,p.make_type,p.make_quantity,p.store_way,p.store_location,p.maker,p.make_time
p.group_id,p.group_name,p.make_type,p.make_quantity,p.store_way,p.store_location,p.maker,p.make_time
FROM FROM
entrust_sample_prepare entrust_sample_prepare
P JOIN entrust_sample s ON P.entrust_sample_id = s.ID P JOIN entrust_sample s ON P.entrust_sample_id = s.ID
......
CREATE TABLE "public"."entrust_sample_record" ( CREATE TABLE "public"."entrust_sample_record" (
...@@ -61,6 +61,6 @@ COMMENT ON COLUMN "public"."entrust_sample"."compliance_test" IS '符合性检 ...@@ -61,6 +61,6 @@ COMMENT ON COLUMN "public"."entrust_sample"."compliance_test" IS '符合性检
-- 新增样品检测项目字段 -- -- 新增样品检测项目字段 --
ALTER TABLE "public"."entrust_sample_item" ALTER TABLE "public"."entrust_sample_item"
ADD COLUMN "univalent" numeric(10,2) default 0.00; ADD COLUMN "price" numeric(10,2) default 0.00;
COMMENT ON COLUMN "public"."entrust_sample_item"."univalent" IS '单价'; COMMENT ON COLUMN "public"."entrust_sample_item"."price" IS '单价';
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