This commit is contained in:
parent
c8fbc97cfa
commit
b27c56082d
|
|
@ -88,4 +88,11 @@ public interface PurchaseBindMapper {
|
|||
* @return
|
||||
*/
|
||||
int updateNum(@Param("dto") PurchaseDto dto, @Param("num") int num);
|
||||
|
||||
/**
|
||||
* 根据id查询详情
|
||||
* @param purchaseDto
|
||||
* @return
|
||||
*/
|
||||
List<PurchaseVo> getDetailById(PurchaseDto purchaseDto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -196,8 +196,9 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService {
|
|||
int result = 0;
|
||||
try {
|
||||
List<PurchaseVo> details = purchaseBindMapper.getDetails(purchaseDto);
|
||||
List<PurchaseVo> purchaseVoList = purchaseBindMapper.getDetailById(purchaseDto);
|
||||
if (CollectionUtils.isNotEmpty(details)) {
|
||||
result += updatePurchaseInfoAndDetails(details, details.get(0), Integer.parseInt(purchaseDto.getPurchaseId()));
|
||||
result += updatePurchaseInfoAndDetails(purchaseVoList, details.get(0), Integer.parseInt(purchaseDto.getPurchaseId()));
|
||||
List<PurchaseVo> statusList = purchaseStorageMapper.select(details.get(0).getTaskId().toString());
|
||||
result += updateTaskStatus(statusList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,4 +281,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getDetailById" resultType="com.bonus.material.purchase.domain.vo.PurchaseVo">
|
||||
SELECT
|
||||
pcd.task_id AS taskId,
|
||||
pcd.id AS purchaseId,
|
||||
mt1.type_name AS materialName,
|
||||
mt.type_name AS materialModel,
|
||||
pcd.check_num AS purchaseNum,
|
||||
pcd.check_num AS checkNum,
|
||||
pcd.bind_num AS bindNum,
|
||||
pcd.type_id as typeId,
|
||||
mt.unit_name AS unitName,
|
||||
ms.supplier AS supplierName,
|
||||
pcd.production_time AS productDate,
|
||||
mt.manage_type AS manageType,
|
||||
pcd.`status` AS STATUS,
|
||||
pm.ma_code AS maCode,
|
||||
pm.out_fac_code AS outFacCode,
|
||||
pm.qr_code AS qrCode
|
||||
FROM
|
||||
purchase_check_details pcd
|
||||
LEFT JOIN tm_task tt ON pcd.task_id = tt.task_id
|
||||
LEFT JOIN purchase_check_info pci ON pci.task_id = pcd.task_id
|
||||
LEFT JOIN ma_type mt ON pcd.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
LEFT JOIN ma_supplier_info ms ON pcd.supplier_id = ms.supplier_id
|
||||
LEFT JOIN purchase_macode_info pm on pcd.task_id = pm.task_id and pm.type_id = pcd.type_id
|
||||
where 1 = 1
|
||||
<if test="typeId != null and typeId != ''">
|
||||
AND mt.id = #{typeId}
|
||||
</if>
|
||||
<if test="taskId != null">
|
||||
AND pcd.task_id = #{taskId}
|
||||
</if>
|
||||
<if test="purchaseId != null">
|
||||
AND pcd.id = #{purchaseId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue