新购驳回
This commit is contained in:
parent
49b4ae203b
commit
87ef699f84
|
|
@ -78,7 +78,7 @@ public interface PurchaseCheckDetailsMapper {
|
|||
int updateCheckDetailsByTaskId(Long taskId);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* 是否为全部不通过
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -117,7 +117,22 @@ public interface PurchaseCheckDetailsMapper {
|
|||
* 查询
|
||||
* @param typeId
|
||||
* @param taskId
|
||||
* @return
|
||||
* @return int
|
||||
*/
|
||||
Integer selectBindNumByTypeId(@Param("typeId") Long typeId, @Param("taskId") Long taskId);
|
||||
|
||||
/**
|
||||
* 判断是否全部已操作(不通过或通过)
|
||||
* @param taskId
|
||||
* @return int
|
||||
*/
|
||||
int isOperateAll(Long taskId);
|
||||
|
||||
/**
|
||||
* 修改purchase_check_details表
|
||||
* @param typeId
|
||||
* @param taskId
|
||||
* @return int
|
||||
*/
|
||||
int updatePurchaseCheckDetailsByTaskId(@Param("taskId") Long taskId,@Param("typeId") Long typeId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.bonus.sgzb.material.domain.BmNoticeInfo;
|
|||
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
|
||||
import com.bonus.sgzb.material.domain.PurchaseInput;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -67,9 +68,10 @@ public interface PurchaseCheckInfoMapper
|
|||
/**
|
||||
* 查询新购入库任务列表
|
||||
* @param taskId
|
||||
** @param type 1-验收,2-入库
|
||||
* @return
|
||||
*/
|
||||
String selectTypeNameByTaskId(Long taskId);
|
||||
String selectTypeNameByTaskId(@Param("taskId") Long taskId,@Param("type") String type);
|
||||
|
||||
/**
|
||||
* 插入
|
||||
|
|
|
|||
|
|
@ -226,4 +226,33 @@ public interface PurchaseMacodeInfoMapper {
|
|||
*/
|
||||
int insertInputApplyDetails(InputApplyDetails applyDetails);
|
||||
|
||||
/**
|
||||
* 删除ma_machine表
|
||||
* @param maId
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteMaMachineInfoByMaId(Long maId);
|
||||
|
||||
/**
|
||||
* 删除purchase_macode_info表
|
||||
* @param taskId
|
||||
* @param typeId
|
||||
* @param maCode
|
||||
* @return
|
||||
*/
|
||||
int updatetePurchaseMaCodeInfoByMaCodeAndTaskIdAndTypeId(@Param("taskId") Long taskId,@Param("typeId") Long typeId,@Param("maCode") String maCode);
|
||||
|
||||
/**
|
||||
* 删除ma_machine_label表
|
||||
* @param maId
|
||||
* @return int
|
||||
*/
|
||||
int deleteMaMachineLabelByMaId(Long maId);
|
||||
|
||||
/**
|
||||
* 删除ma_label_bind表
|
||||
* @param maId
|
||||
* @return int
|
||||
*/
|
||||
int deleteMaLabelBindByMaId(Long maId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,15 +86,28 @@ public class PurchaseCheckDetailsServiceImpl implements IPurchaseCheckDetailsSer
|
|||
purchaseCheckDetails.setUpdateTime(DateUtils.getNowDate());
|
||||
purchaseCheckDetailsMapper.updatePurchaseCheckDetails(purchaseCheckDetails);
|
||||
}
|
||||
// 当全部为已验收,修改任务验收状态
|
||||
int count = purchaseCheckDetailsMapper.selectPurchaseCheckDetailsStatus(taskId);
|
||||
if (count <= 0) {
|
||||
TmTask task = new TmTask();
|
||||
task.setTaskId(taskId);
|
||||
task.setTaskStatus(26);
|
||||
task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
task.setUpdateTime(DateUtils.getNowDate());
|
||||
taskMapper.updateTmTask(task);
|
||||
//判断是否全部已操作(不通过或通过)
|
||||
int count=purchaseCheckDetailsMapper.isOperateAll(taskId);
|
||||
if (count<=0){
|
||||
//是否为全部不通过
|
||||
int count1 = purchaseCheckDetailsMapper.selectPurchaseCheckDetailsStatus(taskId);
|
||||
if (count1 <= 0) {
|
||||
//是则将任务状态改为验收不通过
|
||||
TmTask task = new TmTask();
|
||||
task.setTaskId(taskId);
|
||||
task.setTaskStatus(27);
|
||||
task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
task.setUpdateTime(DateUtils.getNowDate());
|
||||
taskMapper.updateTmTask(task);
|
||||
}else {
|
||||
// 当全部操作,修改任务为验收状态
|
||||
TmTask task = new TmTask();
|
||||
task.setTaskId(taskId);
|
||||
task.setTaskStatus(26);
|
||||
task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
task.setUpdateTime(DateUtils.getNowDate());
|
||||
taskMapper.updateTmTask(task);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
|||
public List<PurchaseCheckInfo> selectPutInListList(PurchaseCheckInfo purchaseCheckInfo) {
|
||||
List<PurchaseCheckInfo> purchaseCheckInfos = purchaseCheckInfoMapper.selectPutInListList(purchaseCheckInfo);
|
||||
for (PurchaseCheckInfo checkInfo : purchaseCheckInfos) {
|
||||
String typeName = purchaseCheckInfoMapper.selectTypeNameByTaskId(checkInfo.getTaskId());
|
||||
String typeName = purchaseCheckInfoMapper.selectTypeNameByTaskId(checkInfo.getTaskId(),"2");
|
||||
checkInfo.setPurchasingTypeName(typeName);
|
||||
}
|
||||
return purchaseCheckInfos;
|
||||
|
|
@ -93,7 +93,7 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
|||
public List<PurchaseCheckInfo> selectPurchaseCheckInfoList(PurchaseCheckInfo purchaseCheckInfo) {
|
||||
List<PurchaseCheckInfo> purchaseCheckInfos = purchaseCheckInfoMapper.selectPurchaseCheckInfoList(purchaseCheckInfo);
|
||||
for (PurchaseCheckInfo checkInfo : purchaseCheckInfos) {
|
||||
String typeName = purchaseCheckInfoMapper.selectTypeNameByTaskId(checkInfo.getTaskId());
|
||||
String typeName = purchaseCheckInfoMapper.selectTypeNameByTaskId(checkInfo.getTaskId(),"1");
|
||||
checkInfo.setPurchasingTypeName(typeName);
|
||||
}
|
||||
return purchaseCheckInfos;
|
||||
|
|
|
|||
|
|
@ -273,17 +273,24 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
|||
List<MaInputRecord> inputRecordList = maInputVO.getInputRecordList();
|
||||
for (MaInputRecord maInputRecord : inputRecordList) {
|
||||
Long typeId = maInputRecord.getTypeId();
|
||||
|
||||
|
||||
// 修改机具入库状态
|
||||
MaMachine maMachine = new MaMachine();
|
||||
maMachine.setMaId(maInputRecord.getMaId());
|
||||
maMachine.setMaCode(maInputRecord.getMaCode());
|
||||
maMachine.setMaStatus("1".equals(checkResult) ? "15" : "14");
|
||||
purchaseMacodeInfoMapper.updateMaMachine(maMachine);
|
||||
|
||||
//修改编码管理表入库状态
|
||||
PurchaseMacodeInfo purchaseMacodeInfo = new PurchaseMacodeInfo();
|
||||
purchaseMacodeInfo.setTaskId(taskId);
|
||||
purchaseMacodeInfo.setTypeId(typeId);
|
||||
purchaseMacodeInfo.setMaCode(maInputRecord.getMaCode());
|
||||
|
||||
// 修改验收任务详细表入库数量
|
||||
if ("1".equals(checkResult)) {
|
||||
//修改机具状态为在库
|
||||
maMachine.setMaStatus("15");
|
||||
purchaseMacodeInfoMapper.updateMaMachine(maMachine);
|
||||
|
||||
|
||||
// 修改编码管理的入库状态
|
||||
MaType maType = purchaseMacodeInfoMapper.selectTypeByTypeId(typeId);
|
||||
// 库存添加
|
||||
|
|
@ -310,17 +317,24 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
|||
applyDetails.setCreateBy(SecurityUtils.getUsername());
|
||||
applyDetails.setCompanyId(maInputRecord.getCompanyId());
|
||||
purchaseMacodeInfoMapper.insertInputApplyDetails(applyDetails);
|
||||
}
|
||||
|
||||
// 修改编码管理表入库状态
|
||||
PurchaseMacodeInfo purchaseMacodeInfo = new PurchaseMacodeInfo();
|
||||
purchaseMacodeInfo.setTaskId(taskId);
|
||||
purchaseMacodeInfo.setTypeId(typeId);
|
||||
purchaseMacodeInfo.setMaCode(maInputRecord.getMaCode());
|
||||
purchaseMacodeInfo.setStatus("1".equals(checkResult) ? "1" : "0");
|
||||
purchaseMacodeInfoMapper.updateMacodeByType(purchaseMacodeInfo);
|
||||
// 新增入库记录
|
||||
purchaseMacodeInfoMapper.insertMaInputRecord(maInputRecord);
|
||||
purchaseMacodeInfo.setStatus("1");
|
||||
purchaseMacodeInfoMapper.updateMacodeByType(purchaseMacodeInfo);
|
||||
|
||||
// 新增入库记录
|
||||
purchaseMacodeInfoMapper.insertMaInputRecord(maInputRecord);
|
||||
}else {
|
||||
//删除ma_machine表
|
||||
purchaseMacodeInfoMapper.deleteMaMachineInfoByMaId(maInputRecord.getMaId());
|
||||
//删除ma_machine_label表
|
||||
purchaseMacodeInfoMapper.deleteMaMachineLabelByMaId(maInputRecord.getMaId());
|
||||
//删除ma_label_bind表
|
||||
purchaseMacodeInfoMapper.deleteMaLabelBindByMaId(maInputRecord.getMaId());
|
||||
//修改purchase_macode_info表
|
||||
purchaseMacodeInfoMapper.updatetePurchaseMaCodeInfoByMaCodeAndTaskIdAndTypeId(taskId,typeId,maInputRecord.getMaCode());
|
||||
//修改purchase_check_details表
|
||||
checkDetailsMapper.updatePurchaseCheckDetailsByTaskId(taskId,typeId);
|
||||
}
|
||||
}
|
||||
|
||||
// 当全部为已入库的时候任务改为入库状态
|
||||
|
|
@ -337,6 +351,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
|||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据机具编码删除编码
|
||||
*
|
||||
|
|
|
|||
|
|
@ -42,17 +42,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join ma_type mt1 on mt.parent_id = mt1.type_id
|
||||
left join ma_supplier_info msi on pcd.supplier_id = msi.supplier_id
|
||||
left join tm_task tk on pcd.task_id = tk.task_id
|
||||
<where>
|
||||
<if test="taskId != null "> and pcd.task_id = #{taskId}</if>
|
||||
<if test="keyWord != null and keyWord != ''">and (mt.type_name like concat('%',#{keyWord},'%')
|
||||
or mt1.type_name like concat('%',#{keyWord}) or msi.supplier like concat('%',#{keyWord}))</if>
|
||||
<if test="typeId != null "> and pcd.type_id = #{typeId}</if>
|
||||
<if test="purchasePrice != null and purchasePrice != ''"> and pcd.purchase_price = #{purchasePrice}</if>
|
||||
<if test="purchaseNum != null "> and pcd.purchase_num = #{purchaseNum}</if>
|
||||
<if test="supplierId != null "> and pcd.supplier_id = #{supplierId}</if>
|
||||
<if test="productionTime != null "> and pcd.production_time = #{productionTime}</if>
|
||||
<if test="companyId != null "> and pcd.company_id = #{companyId}</if>
|
||||
</where>
|
||||
where pcd.status !=3 and pcd.status!=5
|
||||
<if test="taskId != null ">and pcd.task_id = #{taskId}</if>
|
||||
<if test="keyWord != null and keyWord != ''">and (mt.type_name like concat('%',#{keyWord},'%')
|
||||
or mt1.type_name like concat('%',#{keyWord}) or msi.supplier like concat('%',#{keyWord}))
|
||||
</if>
|
||||
<if test="typeId != null ">and pcd.type_id = #{typeId}</if>
|
||||
<if test="purchasePrice != null and purchasePrice != ''">and pcd.purchase_price = #{purchasePrice}</if>
|
||||
<if test="purchaseNum != null ">and pcd.purchase_num = #{purchaseNum}</if>
|
||||
<if test="supplierId != null ">and pcd.supplier_id = #{supplierId}</if>
|
||||
<if test="productionTime != null ">and pcd.production_time = #{productionTime}</if>
|
||||
<if test="companyId != null ">and pcd.company_id = #{companyId}</if>
|
||||
</select>
|
||||
|
||||
<select id="selectPurchaseCheckDetailsByTaskId" parameterType="Long" resultMap="PurchaseCheckDetailsResult">
|
||||
|
|
@ -196,7 +196,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</update>
|
||||
|
||||
<select id="selectPurchaseCheckDetailsStatus" resultType="int">
|
||||
select count(*) from purchase_check_details where task_id = #{taskId} and status != 1
|
||||
select count(*) from purchase_check_details where task_id = #{taskId} and status != 3
|
||||
</select>
|
||||
<select id="selectInputNumByTypeId" resultType="java.math.BigDecimal">
|
||||
select IFNULL(input_num,0) from purchase_check_details where task_id = #{taskId} and type_id = #{typeId}
|
||||
|
|
@ -204,6 +204,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectBindNumByTypeId" resultType="java.lang.Integer">
|
||||
select IFNULL(bind_num, 0) from purchase_check_details where task_id = #{taskId} and type_id = #{typeId}
|
||||
</select>
|
||||
<select id="isOperateAll" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
count(*)
|
||||
FROM
|
||||
purchase_check_details
|
||||
WHERE
|
||||
task_id = #{taskId} and status != 1 and status!=3
|
||||
</select>
|
||||
|
||||
<delete id="deleteCheckDetailsByTaskId">
|
||||
delete from purchase_check_details where task_id = #{taskId}
|
||||
|
|
@ -218,4 +226,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<update id="updateBindByTaskIdTypeId">
|
||||
update purchase_check_details set bind_num = #{bindNum} where task_id = #{taskId} and type_id = #{typeId}
|
||||
</update>
|
||||
<update id="updatePurchaseCheckDetailsByTaskId">
|
||||
update purchase_check_details set bind_num = bind_num - 1 , status='5' where task_id = #{taskId} and type_id = #{typeId}
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -103,12 +103,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="selectTypeNameByTaskId" resultType="java.lang.String">
|
||||
select GROUP_CONCAT(type_name) typeName from
|
||||
(select distinct pcd.task_id, mt1.type_name
|
||||
from purchase_check_details pcd
|
||||
left join ma_type mt on pcd.type_id = mt.type_id
|
||||
left join ma_type mt1 on mt.parent_id = mt1.type_id
|
||||
where pcd.task_id = #{taskId}
|
||||
) t
|
||||
(select distinct pcd.task_id, mt1.type_name
|
||||
from purchase_check_details pcd
|
||||
left join ma_type mt on pcd.type_id = mt.type_id
|
||||
left join ma_type mt1 on mt.parent_id = mt1.type_id
|
||||
where pcd.task_id = #{taskId}
|
||||
<if test="type == 2">and pcd.`status`!=3</if>
|
||||
) t
|
||||
GROUP BY task_id
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join purchase_check_info pt on pcd.task_id = pt.task_id
|
||||
where pcd.task_id = #{taskId}
|
||||
and mt.manage_type = '0'
|
||||
and pcd.`status`!=3
|
||||
and pcd.`status`!=5
|
||||
<if test="typeId != null "> and pmi.type_id = #{typeId}</if>
|
||||
<if test="keyWord != null and keyWord != ''">and (mt.type_name like concat('%',#{keyWord},'%') or mt1.type_name like concat('%',#{keyWord},'%'))</if>
|
||||
<if test="typeName != null and typeName != ''"> and mt1.type_name = #{typeName}</if>
|
||||
|
|
@ -142,6 +144,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
delete from ma_machine where ma_code = #{maCode}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMaMachineInfoByMaId">
|
||||
delete from ma_machine where ma_id = #{maId}
|
||||
</delete>
|
||||
<update id="updatetePurchaseMaCodeInfoByMaCodeAndTaskIdAndTypeId">
|
||||
update
|
||||
purchase_macode_info
|
||||
set status='2'
|
||||
where ma_code = #{maCode}
|
||||
and task_id = #{taskId}
|
||||
and type_id = #{typeId}
|
||||
</update>
|
||||
<delete id="deleteMaMachineLabelByMaId">
|
||||
delete from ma_machine_label where ma_id = #{maId}
|
||||
</delete>
|
||||
<delete id="deleteMaLabelBindByMaId">
|
||||
delete from ma_label_bind where ma_id = #{maId}
|
||||
</delete>
|
||||
|
||||
<select id="selectMachineByAssetsCode" resultType="com.bonus.sgzb.base.api.domain.MaMachine">
|
||||
select ma_id, type_id, ma_code, pre_code, ma_status, qr_code, buy_price, ma_vender, out_fac_time, out_fac_code,
|
||||
assets_code, check_man, this_check_time, next_check_time, gps_code, rfid_code, erp_code, transfer_code,
|
||||
|
|
@ -341,6 +361,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join ma_type mt on pcd.type_id = mt.type_id
|
||||
left join ma_type mt1 on mt.parent_id = mt1.type_id
|
||||
where pcd.task_id = #{taskId}
|
||||
and pcd.`status`!=3
|
||||
order by status
|
||||
</select>
|
||||
<select id="selectMaCode" resultType="java.lang.Integer">
|
||||
|
|
|
|||
Loading…
Reference in New Issue