|
@@ -25,6 +25,7 @@ import com.dayou.exception.ErrorCode;
|
|
|
import com.dayou.mapper.*;
|
|
|
import com.dayou.service.*;
|
|
|
import com.dayou.service.impl.AssetsServiceImpl;
|
|
|
+import com.dayou.service.impl.PersonalProductionServiceImpl;
|
|
|
import com.dayou.utils.DateUtils;
|
|
|
import com.dayou.utils.HttpKit;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -49,6 +50,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
import static com.dayou.common.Constants.*;
|
|
|
import static com.dayou.enums.MainBusinessEnum.*;
|
|
|
+import static com.dayou.enums.ProductionEnum.FINAL;
|
|
|
|
|
|
@DS("dyoa")
|
|
|
@Service
|
|
@@ -340,6 +342,8 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
private DyoaRecordMapper dyoaRecordMapper;
|
|
|
@Autowired
|
|
|
private PersonalTargetMapper personalTargetMapper;
|
|
|
+ @Autowired
|
|
|
+ private IPersonalProductionService personalProductionServiceImpl;
|
|
|
|
|
|
|
|
|
@Override
|
|
@@ -1617,11 +1621,12 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
}
|
|
|
}
|
|
|
else{
|
|
|
- //更新已同步产品的归档状态、归档时间、送达状态、送达时间
|
|
|
+ //更新已同步产品的归档状态、归档时间、送达状态、送达时间、产品出库时间
|
|
|
boolean flog = false;
|
|
|
for (MajorProduction majorProduction :list){
|
|
|
Date archiveTime = productionNo.getArchiveTime();
|
|
|
Date confirmTime = productionNo.getConfirmTime();
|
|
|
+ Date bgOutTime = productionNo.getBgOutTime();
|
|
|
if (archiveTime!=null){
|
|
|
flog = true;
|
|
|
majorProduction.setIfSaveFile(true);
|
|
@@ -1632,13 +1637,19 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
majorProduction.setDelivery(true);
|
|
|
majorProduction.setDeliveryDate(DateUtils.dateToLocalDate(confirmTime));
|
|
|
}
|
|
|
+ if (bgOutTime!=null){
|
|
|
+ flog = true;
|
|
|
+ majorProduction.setRepertoryOutTime(bgOutTime);
|
|
|
+ }
|
|
|
if (flog){
|
|
|
majorProductionService.update(new LambdaUpdateWrapper<MajorProduction>()
|
|
|
.eq(BaseEntity::getId,majorProduction.getId())
|
|
|
.set(majorProduction.getIfSaveFile()!=null,MajorProduction::getIfSaveFile,majorProduction.getIfSaveFile())
|
|
|
.set(majorProduction.getSaveFileDate()!=null,MajorProduction::getSaveFileDate,majorProduction.getSaveFileDate())
|
|
|
.set(majorProduction.getDelivery()!=null,MajorProduction::getDelivery,majorProduction.getDelivery())
|
|
|
- .set(majorProduction.getDeliveryDate()!=null,MajorProduction::getDeliveryDate,majorProduction.getDeliveryDate()));
|
|
|
+ .set(majorProduction.getDeliveryDate()!=null,MajorProduction::getDeliveryDate,majorProduction.getDeliveryDate())
|
|
|
+ .set(majorProduction.getRepertoryOutTime()!=null,MajorProduction::getRepertoryOutTime,majorProduction.getRepertoryOutTime()));
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1777,6 +1788,64 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public Boolean updatePersonalProduction() {
|
|
|
+ List<HisPersonalProduction> list = dyoaRecordMapper.findPersonalProduction();
|
|
|
+ for (HisPersonalProduction hisPersonalProduction : list){
|
|
|
+ Long personalTargetId = dyoaRecordService.getPersonalTargetId(hisPersonalProduction.getId());
|
|
|
+ if (personalTargetId != null){
|
|
|
+ PersonalTarget target = personalTargetService.getById(personalTargetId);
|
|
|
+ if (target!=null){
|
|
|
+ PersonalProduction pp = personalProductionServiceImpl.getOne(new LambdaQueryWrapper<PersonalProduction>()
|
|
|
+ .eq(PersonalProduction::getTargetId, personalTargetId));
|
|
|
+ Date bgOutRepoTime = hisPersonalProduction.getBgOutRepoTime();
|
|
|
+ Date bgInRepoTime = hisPersonalProduction.getBgInRepoTime();
|
|
|
+ if (pp==null){
|
|
|
+ PersonalProduction personalProduction = new PersonalProduction();
|
|
|
+
|
|
|
+ personalProduction.setTargetId(personalTargetId);
|
|
|
+ personalProduction.setProduction(FINAL.name());
|
|
|
+ if (bgOutRepoTime!=null){
|
|
|
+ personalProduction.setRepertoryState(true);
|
|
|
+ personalProduction.setRepertoryOutTime(DateUtils.parseLocalDateTime(DateUtils.dateTime(bgOutRepoTime)));
|
|
|
+ }
|
|
|
+ if (bgInRepoTime!=null){
|
|
|
+ personalProduction.setRepertoryInTime(DateUtils.parseLocalDateTime(DateUtils.dateTime(bgInRepoTime)));
|
|
|
+ }
|
|
|
+ personalProductionServiceImpl.save(personalProduction);
|
|
|
+ }else if(pp.getRepertoryState()==null){
|
|
|
+ pp.setRepertoryState(true);
|
|
|
+ pp.setRepertoryOutTime(DateUtils.parseLocalDateTime(DateUtils.dateTime(bgOutRepoTime)));
|
|
|
+ pp.setRepertoryInTime(DateUtils.parseLocalDateTime(DateUtils.dateTime(bgInRepoTime)));
|
|
|
+ personalProductionServiceImpl.updateById(pp);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Boolean updateAssetsProduction() {
|
|
|
+ List<HisPersonalProduction> assetsProduction = dyoaRecordMapper.findAssetsProduction();
|
|
|
+ for (HisPersonalProduction hisPersonalProduction : assetsProduction){
|
|
|
+ Long assetsId = dyoaRecordService.getMbsIdByDyOAIdForAssets(hisPersonalProduction.getId());
|
|
|
+ if (assetsId != null && hisPersonalProduction.getBgOutRepoTime()!=null){
|
|
|
+ AssetsProduction ap = assetsProductionService.getOne(new LambdaQueryWrapper<AssetsProduction>().eq(AssetsProduction::getBusinessId, assetsId).eq(AssetsProduction::getProductionType,"REPORT"));
|
|
|
+ if (ap!=null && ap.getRepertoryState()==null){
|
|
|
+ ap.setRepertoryState(true);
|
|
|
+ ap.setRepertoryOutTime(DateUtils.parseLocalDateTime(DateUtils.dateTime(hisPersonalProduction.getBgOutRepoTime())));
|
|
|
+ ap.setRepertoryInTime(DateUtils.parseLocalDateTime(DateUtils.dateTime(hisPersonalProduction.getBgInRepoTime())));
|
|
|
+ assetsProductionService.update(ap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
public Boolean updateProductionFund() {
|
|
|
List<OrderFund> orderFunds = orderFundService.getAllOrderFund();
|
|
|
for (OrderFund orderFund : orderFunds) {
|