|
@@ -6,11 +6,10 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.dayou.common.BaseEntity;
|
|
|
import com.dayou.configuration.DfsConfig;
|
|
|
-import com.dayou.dto.ItemData;
|
|
|
-import com.dayou.dto.NameUrlDTO;
|
|
|
-import com.dayou.dto.TaskRecordDTO;
|
|
|
+import com.dayou.dto.*;
|
|
|
import com.dayou.entity.*;
|
|
|
import com.dayou.enums.CertificateEnum;
|
|
|
+import com.dayou.enums.MainBusinessEnum;
|
|
|
import com.dayou.enums.ProductionEnum;
|
|
|
import com.dayou.enums.ReportStatus;
|
|
|
import com.dayou.exception.ErrorCode;
|
|
@@ -76,6 +75,14 @@ public class PersonalProductionServiceImpl extends ServiceImpl<PersonalProductio
|
|
|
@Autowired
|
|
|
private DfsConfig dfsConfig;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ICustomerCompanyService customerCompanyService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private PersonalProductionMapper personalProductionMapper;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public void setResourceLoader(ResourceLoader resourceLoader) {
|
|
|
this.resourceLoader = resourceLoader;
|
|
@@ -397,13 +404,14 @@ public class PersonalProductionServiceImpl extends ServiceImpl<PersonalProductio
|
|
|
public Boolean repertoryOut(TaskRecordDTO<PersonalProduction> taskRecordDTO) {
|
|
|
PersonalProduction taskData = taskRecordDTO.getTaskData();
|
|
|
List<PersonalProduction> productions;
|
|
|
+ Long targetId = taskData.getTargetId();
|
|
|
if (taskData.getProduction().equals(STATEMENT.name())){
|
|
|
productions = this.list(new LambdaQueryWrapper<PersonalProduction>()
|
|
|
- .eq(PersonalProduction::getTargetId,taskData.getTargetId()).eq(PersonalProduction::getProduction,taskData.getProduction())
|
|
|
+ .eq(PersonalProduction::getTargetId, targetId).eq(PersonalProduction::getProduction,taskData.getProduction())
|
|
|
.eq(BaseEntity::getDeleted, Boolean.FALSE));
|
|
|
}else {
|
|
|
productions = this.list(new LambdaQueryWrapper<PersonalProduction>()
|
|
|
- .eq(PersonalProduction::getTargetId,taskData.getTargetId()).ne(PersonalProduction::getProduction,STATEMENT.name())
|
|
|
+ .eq(PersonalProduction::getTargetId, targetId).ne(PersonalProduction::getProduction,STATEMENT.name())
|
|
|
.eq(BaseEntity::getDeleted, Boolean.FALSE));
|
|
|
}
|
|
|
|
|
@@ -412,18 +420,27 @@ public class PersonalProductionServiceImpl extends ServiceImpl<PersonalProductio
|
|
|
return this.update(new LambdaUpdateWrapper<PersonalProduction>().set(PersonalProduction::getRepertoryState, Boolean.TRUE).set(PersonalProduction::getRepertoryOutTime,new Date())
|
|
|
.eq(BaseEntity::getId, productions.get(0).getId()));
|
|
|
}else{
|
|
|
- //非价值意见书 需做出库前校验
|
|
|
-// Long outId = beforeOutCheck(production);
|
|
|
-// //更新申请记录中的出库状态
|
|
|
-// if (outId!=null){
|
|
|
-// outWarehouseService.update(new LambdaUpdateWrapper<ProductionOutWarehouse>().set(ProductionOutWarehouse::getProductionOut,Boolean.TRUE).eq(BaseEntity::getId,outId));
|
|
|
-// return this.update(new LambdaUpdateWrapper<MajorProduction>().set(MajorProduction::getRepertoryState, Boolean.TRUE)
|
|
|
-// .set(MajorProduction::getRepertoryOutTime,new Date()).set(MajorProduction::getDelivery,Boolean.TRUE)
|
|
|
-// .eq(BaseEntity::getId, production.getId()));
|
|
|
-// }else{
|
|
|
-// ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR, "财务部未审核或审核不通过,产品暂时无法出库。");
|
|
|
-// return Boolean.FALSE;
|
|
|
-// }
|
|
|
+ //非意见书 需做出库前校验
|
|
|
+ if (!customerCompanyService.avoidWareHouseApplyByTargetId(targetId)){
|
|
|
+ //验证是否有出库申请并且审核通过
|
|
|
+
|
|
|
+ }
|
|
|
+ List<Long> productionIds = productions.stream().map(BaseEntity::getId).collect(Collectors.toList());
|
|
|
+ return this.update(new LambdaUpdateWrapper<PersonalProduction>().set(PersonalProduction::getRepertoryState,Boolean.TRUE)
|
|
|
+ .set(PersonalProduction::getRepertoryOutTime,new Date()).in(BaseEntity::getId,productionIds));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public OrderProductionsBag productionBag(Long id) {
|
|
|
+ //获取产品信息
|
|
|
+ List<ProductionDTO> productions = personalProductionMapper.getProductions(id);
|
|
|
+ if (CollectionUtil.isNotEmpty(productions)){
|
|
|
+ OrderProductionsBag orderProductionsBag = new OrderProductionsBag();
|
|
|
+ orderProductionsBag.setBusinessId(id);
|
|
|
+ orderProductionsBag.setBusinessType(MainBusinessEnum.PERSONAL_BUSINESS.name());
|
|
|
+ orderProductionsBag.setProductions(productions);
|
|
|
+ return orderProductionsBag;
|
|
|
}
|
|
|
return null;
|
|
|
}
|