|
@@ -17,6 +17,8 @@ import com.rongwei.bsentity.domain.*;
|
|
|
import com.rongwei.bscommon.sys.dao.ZhcxOutsideInspectionItpDao;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.rongwei.bsentity.dto.*;
|
|
|
+import com.rongwei.bsentity.dto.outside.OutsideInspectionInsertRequest;
|
|
|
+import com.rongwei.bsentity.dto.outside.OutsideInspectionUpdateRequest;
|
|
|
import com.rongwei.bsentity.vo.*;
|
|
|
import com.rongwei.commonservice.serial.service.SysSerialNumberService;
|
|
|
import com.rongwei.rwadmincommon.system.service.SysGeneralCRUDService;
|
|
@@ -95,6 +97,58 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
|
@Autowired
|
|
|
private ZhcxItpProjectNodesService itpProjectNodesService;
|
|
|
|
|
|
+ /**
|
|
|
+ * 保存外部报验单
|
|
|
+ *
|
|
|
+ * @param req
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void insertInspection(OutsideInspectionInsertRequest req) {
|
|
|
+
|
|
|
+ //保存单据
|
|
|
+ try {
|
|
|
+ sysGeneralCRUDService.generalMsInsert(req.getInsert());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("保存失败: {}", e);
|
|
|
+ throw new CustomException("保存失败");
|
|
|
+ }
|
|
|
+ //拆分
|
|
|
+ splitOrder(req.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改外部报验单
|
|
|
+ *
|
|
|
+ * @param req
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void updateInspection(OutsideInspectionUpdateRequest req) {
|
|
|
+ //修改操作
|
|
|
+ if(ObjectUtil.isEmpty(req.getOperType()) || "updateInspection".equals(req.getOperType())) {
|
|
|
+ ZhcxOutsideInspectionItpDo itpDo = this.getById(req.getId()); //报验单
|
|
|
+
|
|
|
+ //报验单中编码不存在,为首次提交,不需要生成修改记录
|
|
|
+ if(ObjectUtil.isNotEmpty(itpDo.getInspectioncode())) {
|
|
|
+ saveEditHistory(itpDo, req.getUpdate()); //保存历史记录
|
|
|
+ }
|
|
|
+
|
|
|
+ //保存单据
|
|
|
+ try {
|
|
|
+ sysGeneralCRUDService.generalMsUpdate(req.getUpdate());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("保存失败: {}", e);
|
|
|
+ throw new CustomException("保存失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ //单个报验点保存后操作
|
|
|
+ saveSingle(itpDo);
|
|
|
+ }
|
|
|
+ //重新报验
|
|
|
+ else if("reInspection".equals(req.getOperType())) {
|
|
|
+ reInspection(req.getId(), req.getUpdate());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 拆单
|
|
|
*
|