新购优化
This commit is contained in:
parent
718479acd8
commit
6f0f9c06f6
|
|
@ -169,4 +169,12 @@ public class PurchaseCheckDetails extends BaseEntity {
|
|||
//@Excel(name = "验收附件列表")
|
||||
@ApiModelProperty(value = "验收附件列表")
|
||||
private List<BmFileInfo> bmFileInfos;
|
||||
|
||||
/** 是否有附件 */
|
||||
@ApiModelProperty(value = "是否有附件 0 是, 1 否")
|
||||
private Integer isExitFile;
|
||||
|
||||
/** 租赁价格 */
|
||||
@ApiModelProperty(value = "租赁价格")
|
||||
private BigDecimal rentPrice;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ import com.bonus.common.security.utils.SecurityUtils;
|
|||
import com.bonus.material.basic.domain.BmFileInfo;
|
||||
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||
import com.bonus.material.basic.service.IBmConfigService;
|
||||
import com.bonus.material.ma.domain.Type;
|
||||
import com.bonus.material.ma.mapper.TypeMapper;
|
||||
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
||||
import com.bonus.material.purchase.domain.dto.PurchaseCheckDto;
|
||||
import com.bonus.material.purchase.domain.dto.PurchaseQueryDto;
|
||||
|
|
@ -66,6 +68,9 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
|||
@Resource
|
||||
BmFileInfoMapper bmFileInfoMapper;
|
||||
|
||||
@Resource
|
||||
private TypeMapper typeMapper;
|
||||
|
||||
// 引入新购任务阶段常量
|
||||
private static final int PURCHASE_TASK_STAGE_MANAGE = 1;
|
||||
private static final int PURCHASE_TASK_STAGE_CHECK = 2;
|
||||
|
|
@ -112,8 +117,8 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
|||
System.err.println("未知的新购任务阶段:" + purchaseQueryDto.getTaskStage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//查询是否存在附件,给前端用于文件颜色判断
|
||||
extractedExitFile(purchaseCheckDetailsList);
|
||||
//针对于app查询可能存在的验收图片
|
||||
extractedFile(purchaseCheckDetailsList);
|
||||
purchaseCheckDtoResult.setPurchaseCheckDetailsList(purchaseCheckDetailsList);
|
||||
|
|
@ -121,6 +126,27 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
|||
return purchaseCheckDtoResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询是否存在附件,给前端用于文件颜色判断
|
||||
* @param purchaseCheckDetailsList
|
||||
*/
|
||||
private void extractedExitFile(List<PurchaseCheckDetails> purchaseCheckDetailsList) {
|
||||
if (!CollectionUtils.isEmpty(purchaseCheckDetailsList)) {
|
||||
for (PurchaseCheckDetails purchaseCheckDetails : purchaseCheckDetailsList) {
|
||||
final BmFileInfo fileInfo = new BmFileInfo();
|
||||
fileInfo.setTaskType(0);
|
||||
fileInfo.setModelId(purchaseCheckDetails.getTypeId());
|
||||
fileInfo.setTaskId(purchaseCheckDetails.getTaskId());
|
||||
final List<BmFileInfo> bmFileInfoList = bmFileInfoMapper.selectBmFileInfoList(fileInfo);
|
||||
if (!CollectionUtils.isEmpty(bmFileInfoList)) {
|
||||
purchaseCheckDetails.setIsExitFile(0);
|
||||
}else {
|
||||
purchaseCheckDetails.setIsExitFile(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 提取app新购验收文件信息
|
||||
* @param purchaseCheckDetailsList 新购验收明细列表
|
||||
|
|
@ -340,6 +366,15 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
|||
bmFileInfos.forEach(o -> o.setTaskId(taskId));
|
||||
bmFileInfoMapper.insertBmFileInfos(bmFileInfos);
|
||||
}
|
||||
Type type = new Type();
|
||||
Type maType = typeMapper.getMaType(details.getTypeId());
|
||||
if (maType != null && (maType.getRentPrice() == null || maType.getRentPrice().compareTo(BigDecimal.ZERO) == 0)) {
|
||||
type.setTypeId(details.getTypeId());
|
||||
type.setRentPrice(details.getRentPrice());
|
||||
type.setUpdateTime(DateUtils.getNowDate());
|
||||
type.setUpdateBy(SecurityUtils.getUserId().toString());
|
||||
typeMapper.updateType(type);
|
||||
}
|
||||
}
|
||||
// 批量插入详情数据
|
||||
final int count = purchaseCheckDetailsMapper.insertPurchaseCheckDetailsList(purchaseCheckDetailsList);
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
pcd.supplier_id, pcd.status, pcd.create_by, pcd.production_time, pcd.create_time, pcd.update_by, pcd.update_time,
|
||||
pcd.remark, pcd.check_url_name, pcd.check_url, pcd.input_num, pcd.input_status, pcd.input_time, pcd.file_name,
|
||||
pcd.file_url, pcd.company_id, pcd.fix_code, mt.type_name, mt.unit_name, mt.unit_value,mtp.type_name as ma_type_name, mt.manage_type as manage_type,
|
||||
pcd.warn_documents as warnDocuments, pcd.reason as reason
|
||||
pcd.warn_documents as warnDocuments, pcd.reason as reason, mt.rent_price as rentPrice
|
||||
from purchase_check_details pcd
|
||||
left join ma_type mt on pcd.type_id = mt.type_id
|
||||
left join ma_type mtp on mt.parent_id = mtp.type_id
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select
|
||||
sad.id as id,sad.task_id as taskId,sad.parent_id as parentId,sad.ma_id as maId,
|
||||
sad.status as status,rad.repair_id as repairId,
|
||||
sad.scrap_source,sad.scrap_type,ifnull(sad.scrap_num,0) as scrapNum,
|
||||
sad.scrap_source as scrapSource, sad.scrap_type as scrapType, ifnull(sad.scrap_num,0) as scrapNum,
|
||||
sad.audit_by,sad.audit_remark,sad.audit_time as auditTime,
|
||||
sad.update_time as updateTime,sad.type_id as typeId,
|
||||
sad.create_by,sad.create_time,sad.file_name,sad.file_url,
|
||||
|
|
|
|||
Loading…
Reference in New Issue