入库盘点
This commit is contained in:
parent
6a21d5e7a3
commit
078f3a6241
|
|
@ -73,6 +73,11 @@ public interface InventoryAndWarehousingMapper {
|
|||
*/
|
||||
int selectTaskNumByMonth(@Param("date") Date nowDate);
|
||||
|
||||
/**
|
||||
* 根据二维码code查重
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
int selectByCode(String code);
|
||||
|
||||
/**
|
||||
|
|
@ -81,4 +86,11 @@ public interface InventoryAndWarehousingMapper {
|
|||
* @return
|
||||
*/
|
||||
List<PutInStorageBean> getDetails(PutInStorageBean bean);
|
||||
|
||||
/**
|
||||
* 根据macode查重
|
||||
* @param maCode
|
||||
* @return
|
||||
*/
|
||||
int selectByMaCode(String maCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.sgzb.material.service.impl;
|
||||
|
||||
import com.bonus.sgzb.common.core.exception.ServiceException;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
|
|
@ -86,6 +87,15 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
|
|||
}
|
||||
}
|
||||
String code = genderBackCode();
|
||||
List<MachIneDto> machIneDtoList = dto.getMachIneDtoList();
|
||||
if (CollectionUtils.isNotEmpty(machIneDtoList)) {
|
||||
for (MachIneDto machIneDto : machIneDtoList) {
|
||||
int count = selectByMaCode(machIneDto.getMaCode());
|
||||
if (count != 0) {
|
||||
throw new ServiceException("以下设备编码与库中数据存在重复,请修改后重新提交:" + machIneDto.getMaCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
int res;
|
||||
try {
|
||||
//1. 判断是数量还是编号入库,保存到不同表
|
||||
|
|
@ -119,6 +129,15 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
|
|||
return AjaxResult.success(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备编码code查重
|
||||
* @param maCode
|
||||
* @return
|
||||
*/
|
||||
private int selectByMaCode(String maCode) {
|
||||
return inventoryAndWarehousingMapper.selectByMaCode(maCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据入库单号查看详情
|
||||
* @param bean
|
||||
|
|
@ -153,6 +172,9 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
|
|||
machIneDto.setCreator(dto.getCreator());
|
||||
machIneDto.setNum(dto.getNum());
|
||||
machIneDto.setIsCode(dto.getIsCode());
|
||||
machIneDto.setUnitId(dto.getUnitId());
|
||||
machIneDto.setProId(dto.getProId());
|
||||
machIneDto.setRemarks(dto.getRemarks());
|
||||
res += insertInfo(machIneDto);
|
||||
machIneDto.setInfoId(machIneDto.getId());
|
||||
}
|
||||
|
|
@ -164,7 +186,6 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
|
|||
machIneDto.setIsCode(dto.getIsCode());
|
||||
machIneDto.setTypeId(dto.getTypeId());
|
||||
machIneDto.setCreator(dto.getCreator());
|
||||
machIneDto.setRemarks(dto.getRemarks());
|
||||
machIneDto.setPutInType(dto.getPutInType());
|
||||
machIneDto.setNum(dto.getNum());
|
||||
machIneDto.setCheckMan(dto.getCheckMan());
|
||||
|
|
@ -234,6 +255,7 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
|
|||
machIneDto.setCreator(dto.getCreator());
|
||||
machIneDto.setIsCode(dto.getIsCode());
|
||||
machIneDto.setTotalNum(total);
|
||||
machIneDto.setRemarks(dto.getRemarks());
|
||||
res += insertInfo(machIneDto);
|
||||
machIneDto.setInfoId(machIneDto.getId());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<if test="maId != null and maId != ''">
|
||||
MACHINE,
|
||||
</if>
|
||||
<if test="remarks != null and remarks != ''">
|
||||
<if test="remark != null and remark != ''">
|
||||
REMARKS,
|
||||
</if>
|
||||
<if test="maCode != null and maCode != ''">
|
||||
|
|
@ -54,8 +54,8 @@
|
|||
<if test="maId != null and maId != ''">
|
||||
#{maId},
|
||||
</if>
|
||||
<if test="remarks != null and remarks != ''">
|
||||
#{remarks},
|
||||
<if test="remark != null and remark != ''">
|
||||
#{remark},
|
||||
</if>
|
||||
<if test="maCode != null and maCode != ''">
|
||||
#{maCode},
|
||||
|
|
@ -81,17 +81,8 @@
|
|||
<if test="unitId != null and unitId != ''">UNIT_ID,</if>
|
||||
<if test="proId != null and proId != ''">PROJECT_ID,</if>
|
||||
<if test="code != null and code != ''">CODE,</if>
|
||||
CREATE_DATE,
|
||||
<choose>
|
||||
<when test="isCode and remarks != null and remarks != ''">
|
||||
REMARKS
|
||||
</when>
|
||||
<otherwise>
|
||||
<if test="remark != null and remark != ''">
|
||||
REMARKS
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="remarks != null and remarks != ''">REMARKS,</if>
|
||||
CREATE_DATE
|
||||
</trim>
|
||||
VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -110,17 +101,8 @@
|
|||
<if test="unitId != null and unitId != ''">#{unitId},</if>
|
||||
<if test="proId != null and proId != ''">#{proId},</if>
|
||||
<if test="code != null and code != ''">#{code},</if>
|
||||
sysdate(),
|
||||
<choose>
|
||||
<when test="isCode and remarks != null and remarks != ''">
|
||||
#{remarks}
|
||||
</when>
|
||||
<otherwise>
|
||||
<if test="remark != null and remark != ''">
|
||||
#{remark}
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="remarks != null and remarks != ''">#{remarks},</if>
|
||||
sysdate()
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertMachine" useGeneratedKeys="true" keyProperty="maId">
|
||||
|
|
@ -262,7 +244,8 @@
|
|||
mt2.type_name as typeName,
|
||||
mt.type_name as typeModelName,
|
||||
su.user_name as modelName,
|
||||
pisi.CREATE_DATE as createDate
|
||||
pisi.CREATE_DATE as createDate,
|
||||
pisd.REMARKS as remark
|
||||
FROM ma_type_put_in_storage_info pisi
|
||||
LEFT JOIN ma_type_put_in_storage_details pisd on pisi.id = pisd.INFO
|
||||
LEFT JOIN bm_project_lot lot on lot.lot_id = pisi.PROJECT_ID
|
||||
|
|
@ -286,4 +269,11 @@
|
|||
</if>
|
||||
order by pisi.CREATE_DATE desc
|
||||
</select>
|
||||
<select id="selectByMaCode" resultType="java.lang.Integer">
|
||||
select count(*)
|
||||
from ma_machine
|
||||
<where>
|
||||
<if test="maCode != null ">and ma_code = #{maCode}</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue