新购接口优化
This commit is contained in:
parent
1c5c242215
commit
f05ec76759
|
|
@ -142,6 +142,11 @@ public class PurchaseCheckDetails extends BaseEntity {
|
|||
@ApiModelProperty(value = "是否是固定资产编号(0 否,1 是)")
|
||||
private String fixCode;
|
||||
|
||||
/** 管理方式(0编号 1计数) */
|
||||
@Excel(name = "管理方式(0编号 1计数)")
|
||||
@ApiModelProperty(value = "管理方式(0编号 1计数)")
|
||||
private Integer manageType;
|
||||
|
||||
/** 验收附件列表 */
|
||||
//@Excel(name = "验收附件列表")
|
||||
@ApiModelProperty(value = "验收附件列表")
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import java.util.concurrent.atomic.AtomicLong;
|
|||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
import com.bonus.common.biz.constant.BmConfigItems;
|
||||
import com.bonus.common.biz.enums.MaTypeManageTypeEnum;
|
||||
import com.bonus.common.biz.enums.PurchaseTaskStatusEnum;
|
||||
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
|
|
@ -100,6 +101,9 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
|||
boolean isAllowPartTransfer = bmConfigService.isBmConfigEnabledWithDefaultFalse(BmConfigItems.BOOLEAN_ALLOW_PURCHASE_PART_TRANSFER);
|
||||
for (PurchaseCheckInfo purchaseInfo : purchaseCheckInfos) {
|
||||
List<PurchaseCheckDetails> purchaseCheckDetails = purchaseCheckDetailsMapper.selectPurchaseCheckDetailsListByTaskId(purchaseInfo.getTaskId(), null);
|
||||
// 筛除:绑定状态 + 数量设备
|
||||
purchaseCheckDetails = purchaseCheckDetails.stream().filter(o -> !(MaTypeManageTypeEnum.NUMBER_DEVICE.getTypeId().equals(o.getManageType()) &&
|
||||
(o.getStatus().equals(PurchaseTaskStatusEnum.TO_BIND.getStatus()) || o.getStatus().equals(PurchaseTaskStatusEnum.TO_BIND_AFTER_REJECT.getStatus())))).collect(Collectors.toList());
|
||||
OptionalInt minStatus = purchaseCheckDetails.stream().mapToInt(PurchaseCheckDetails::getStatus).min();
|
||||
OptionalInt maxStatus = purchaseCheckDetails.stream().mapToInt(PurchaseCheckDetails::getStatus).max();
|
||||
if (isAllowPartTransfer) {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="fileUrl" column="file_url" />
|
||||
<result property="companyId" column="company_id" />
|
||||
<result property="fixCode" column="fix_code" />
|
||||
<result property="manageType" column="manage_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPurchaseCheckDetailsVo">
|
||||
|
|
@ -43,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select pcd.id, pcd.task_id, pcd.type_id, pcd.purchase_price, pcd.purchase_tax_price, pcd.purchase_num, pcd.check_num, pcd.bind_num, pcd.check_result,
|
||||
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, mtp.type_name as ma_type_name
|
||||
pcd.file_url, pcd.company_id, pcd.fix_code, mt.type_name, mt.unit_name, mtp.type_name as ma_type_name, mt.manage_type as manage_type
|
||||
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
|
||||
|
|
@ -88,9 +89,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectPurchaseCheckDetailsListByTaskId" resultMap="PurchaseCheckDetailsResult">
|
||||
<include refid="selectPurchaseCheckDetailsJoinVo"/>
|
||||
where 1=1
|
||||
<if test="status != null">
|
||||
and pcd.status = #{status}
|
||||
</if>
|
||||
<!-- <if test="status != null">-->
|
||||
<!-- and pcd.status = #{status}-->
|
||||
<!-- </if>-->
|
||||
<if test="taskId != null">
|
||||
and pcd.task_id = #{taskId}
|
||||
</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue