diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java index 9ef3b5d6..820cdb07 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java @@ -8,6 +8,7 @@ import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose; import com.foreverwin.mesnac.anomaly.service.AbnormalBillService; import com.foreverwin.mesnac.anomaly.service.FileUploadedService; import com.foreverwin.mesnac.common.dto.SfcDispatchDto; +import com.foreverwin.mesnac.common.service.AnomalyService; import com.foreverwin.mesnac.common.service.SfcDispatchCommonService; import com.foreverwin.modular.core.util.FrontPage; import com.foreverwin.modular.core.util.R; @@ -36,6 +37,12 @@ public class AbnormalBillController { @Autowired private FileUploadedService fileUploadedService; + @Autowired + public AnomalyService anomalyService; + + + + /** @@ -317,4 +324,10 @@ public class AbnormalBillController { public R clear(String type){ return R.ok(abnormalBillService.getNextNumber(type)); } + + @GetMapping("/test") + public R test(String category, String resource, String shopOrder, String sfc, String ncCodes ){ + anomalyService.createAnomalyTask(category,resource,shopOrder,sfc,ncCodes); + return R.ok(); + } } \ No newline at end of file diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java index 677c0f30..1f28a63d 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java @@ -12,16 +12,15 @@ import com.foreverwin.mesnac.anomaly.service.*; import com.foreverwin.mesnac.common.constant.Constants; import com.foreverwin.mesnac.common.enums.HandleEnum; import com.foreverwin.mesnac.common.helper.NextNumberHelper; +import com.foreverwin.mesnac.common.service.AnomalyService; import com.foreverwin.mesnac.common.util.StringUtil; -import com.foreverwin.mesnac.meapi.mapper.NcGroupMapper; -import com.foreverwin.mesnac.meapi.mapper.NwaUserMapper; -import com.foreverwin.mesnac.meapi.mapper.ResrceMapper; -import com.foreverwin.mesnac.meapi.mapper.ShopOrderMapper; +import com.foreverwin.mesnac.meapi.mapper.*; import com.foreverwin.mesnac.meapi.model.*; import com.foreverwin.mesnac.meapi.service.*; import com.foreverwin.modular.core.exception.BusinessException; import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.FrontPage; +import com.visiprise.common.exception.BaseException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.stereotype.Service; @@ -40,7 +39,7 @@ import java.util.*; */ @Service @Transactional(rollbackFor = Exception.class) -public class AbnormalBillServiceImpl extends ServiceImpl implements AbnormalBillService { +public class AbnormalBillServiceImpl extends ServiceImpl implements AbnormalBillService, AnomalyService { @@ -95,6 +94,9 @@ public class AbnormalBillServiceImpl extends ServiceImpl 0){ abnormalCauseService.saveOrUpdateBatch(causeTypes); } - //放置图片 - this.fileUpload(abnormalBill); - + if(StringUtil.isBlank(abnormalBill.getFileName())){ + //放置图片 + this.fileUpload(abnormalBill); + } return message; } @@ -587,6 +590,53 @@ public class AbnormalBillServiceImpl extends ServiceImpl paramMap) { @@ -126,4 +128,6 @@ public class NextNumberController { public R getNextNumber(String numberType, int qty){ return R.ok(nextNumberHelper.getNextNumber(CommonMethods.getSite(), numberType, qty, null)); } + + } \ No newline at end of file diff --git a/common/src/main/java/com/foreverwin/mesnac/common/service/AnomalyService.java b/common/src/main/java/com/foreverwin/mesnac/common/service/AnomalyService.java new file mode 100644 index 00000000..dc654a8c --- /dev/null +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/AnomalyService.java @@ -0,0 +1,20 @@ +package com.foreverwin.mesnac.common.service; + +/** + * @Description TODO + * @Author zhaojiawei + * @Since 2021-07-12 + */ +public interface AnomalyService { + + + /** + * 生产自报 + * @param category + * @param resource + * @param shopOrder + * @param sfc + * @param ncCodes + */ + void createAnomalyTask(String category, String resource, String shopOrder, String sfc, String ncCodes); +}