Commit 8aed6bf4 authored by yangyang's avatar yangyang

feat(检验报告):1.接收接口; 2.驳回接口; 3.撤回接口;

parent b48b1928
package com.yeejoin.amos.boot.module.jyjc.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
* ProjectName: amos-boot-biz
* PackageName: com.yeejoin.amos.boot.module.jyjc.api.enums
*
* @author yangyang
* @version v1.0
* @date 2023/12/15 16:25
*/
@Getter
@AllArgsConstructor
public enum BizTypeEnum {
SUPERVISE("supervise", "监督检验"),
FIRST_INSPECTION("firstinspect", "定检"),
DETECTION("detection", "检测");
private String code;
private String name;
public static List<String> getEnumNameList() {
List<String> codeList = new ArrayList<String>();
for (BizTypeEnum c : BizTypeEnum.values()) {
codeList.add(c.getCode());
}
return codeList;
}
}
......@@ -277,7 +277,7 @@ public class JyjcInspectionApplicationController extends BaseController {
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST",value = "接收", notes = "接收")
@PostMapping(value = "/flow/{type}/execute")
@PostMapping(value = "/flow/{type}/receive")
public ResponseModel<HashMap<String,String>> execueFlow(@PathVariable(value = "type") String type, @RequestBody Map<String, Object> params) {
params.put("type", type);
jyjcInspectionApplicationServiceImpl.doReceive(params);
......@@ -298,8 +298,8 @@ public class JyjcInspectionApplicationController extends BaseController {
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "退回", notes = "退回")
@GetMapping(value = "/flow/reject")
public void rejectflow(@RequestBody Map<String,Object> params) {
@PostMapping(value = "/flow/reject")
public void doRejectFlow(@RequestBody Map<String,Object> params) {
jyjcInspectionApplicationServiceImpl.doReject(params);
}
......@@ -316,7 +316,7 @@ public class JyjcInspectionApplicationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "撤回", notes = "撤回")
@GetMapping(value = "/flow/rollback")
public void overflow( @RequestParam("instanceId") String instanceId) {
public void doRollbackFlow(@RequestParam("instanceId") String instanceId) {
jyjcInspectionApplicationServiceImpl.doRollback(instanceId);
}
}
......@@ -94,6 +94,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
public void doReceive(Map<String, Object> params) {
execueFlow(params);
// 执行接收业务
String type = (String) params.get("type");
Long sequenceNbr = (Long) params.get("sequenceNbr");
JyjcInspectionApplicationModel inspectionApplicationModel = this.queryBySeq(sequenceNbr);
List<JyjcInspectionApplicationEquipModel> applicationEquipModels = applicationEquipService.listApplicationEquipByApplicationSeq(sequenceNbr);
......@@ -116,7 +117,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
inspectionResultService.saveOrUpdateBatch(resultModels);
// 通知对应的检验机构
Map<String, Object> thiryPartParams = MapBuilder.<String, Object>create().put("inspectionApplication", inspectionApplicationModel).put("applicationEquips", applicationEquipModels).build();
JyjcInspectionApplicationHandlerFactory.apply(inspectionApplicationModel.getBizType()).notifyInspectionUnit(thiryPartParams);
JyjcInspectionApplicationHandlerFactory.apply(type).notifyInspectionUnit(thiryPartParams);
}
/**
......
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl.handler;
import com.yeejoin.amos.boot.module.jyjc.api.enums.BizTypeEnum;
import org.springframework.stereotype.Component;
import java.util.Map;
/**
* 检测
* <p>
* ProjectName: amos-boot-biz
* PackageName: com.yeejoin.amos.boot.module.jyjc.biz.service.impl.handler
*
* @author yangyang
* @version v1.0
* @date 2023/12/15 16:32
*/
@Component
public class DetectionInspectionApplicationHandlerServiceImpl extends AbstractJyjcInspectionApplicationHandlerServiceImpl {
@Override
public String type() {
return BizTypeEnum.DETECTION.getCode();
}
@Override
public boolean notifyInspectionUnit(Map<String, Object> params) {
super.notifyInspectionUnit(params);
// todo
return true;
}
}
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl.handler;
import com.yeejoin.amos.boot.module.jyjc.api.enums.BizTypeEnum;
import org.springframework.stereotype.Component;
import java.util.Map;
/**
* 定检
* <p>
* ProjectName: amos-boot-biz
* PackageName: com.yeejoin.amos.boot.module.jyjc.biz.service.impl.handler
*
* @author yangyang
* @version v1.0
* @date 2023/12/15 16:32
*/
@Component
public class FirstInspectionApplicationHandlerServiceImpl extends AbstractJyjcInspectionApplicationHandlerServiceImpl {
@Override
public String type() {
return BizTypeEnum.FIRST_INSPECTION.getCode();
}
@Override
public boolean notifyInspectionUnit(Map<String, Object> params) {
super.notifyInspectionUnit(params);
// todo
return true;
}
}
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl.handler;
import com.yeejoin.amos.boot.module.jyjc.api.enums.BizTypeEnum;
import org.springframework.stereotype.Component;
import java.util.Map;
/**
* 监督检验
*
* <p>
* ProjectName: amos-boot-biz
* PackageName: com.yeejoin.amos.boot.module.jyjc.biz.service.impl.handler
*
* @author yangyang
* @version v1.0
* @date 2023/12/15 16:32
*/
@Component
public class SuperviseInspectionApplicationHandlerServiceImpl extends AbstractJyjcInspectionApplicationHandlerServiceImpl {
@Override
public String type() {
return BizTypeEnum.SUPERVISE.getCode();
}
@Override
public boolean notifyInspectionUnit(Map<String, Object> params) {
super.notifyInspectionUnit(params);
// todo
return true;
}
}
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