新购及标准箱出库页面详情
This commit is contained in:
parent
2cfd473981
commit
224b71336d
|
|
@ -29,6 +29,9 @@ public class LeaseOutDetails extends BaseEntity {
|
|||
@ApiModelProperty(value = "任务ID")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "标准箱ID")
|
||||
private Long boxId;
|
||||
|
||||
/** 规格ID */
|
||||
@Excel(name = "规格ID")
|
||||
@ApiModelProperty(value = "规格ID")
|
||||
|
|
|
|||
|
|
@ -120,6 +120,16 @@ public class BmQrBoxController extends BaseController {
|
|||
return qrBoxService.getBoxInfoBindListByCode(bmQrBoxInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* app出库查询标准箱绑定详情
|
||||
* @param bmQrBoxInfo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/get_box_bind_by_code")
|
||||
public AjaxResult getBoxBindListByCode(@NotNull(message = "参数不能为空") BmQrBoxInfo bmQrBoxInfo) {
|
||||
return qrBoxService.getBoxBindListByCode(bmQrBoxInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* APP -- 扫码绑定机具
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -97,4 +97,7 @@ public class BmQrBoxInfo extends BaseEntity
|
|||
@ApiModelProperty(value = "状态集合")
|
||||
private List<String> statusList;
|
||||
|
||||
@ApiModelProperty(value = "标准箱信息")
|
||||
private String msg;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.basic.mapper;
|
||||
|
||||
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
||||
import com.bonus.material.basic.domain.BmQrBoxInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -81,4 +82,18 @@ public interface BmQrBoxMapper {
|
|||
* 根据二维码标准箱编码查询绑定详情
|
||||
*/
|
||||
List<BmQrBoxInfo> getBoxBindList(Long boxId);
|
||||
|
||||
/**
|
||||
* 根据二维码标准箱编码查询绑定详情
|
||||
* @param bmQrBoxInfo
|
||||
* @return
|
||||
*/
|
||||
List<BmQrBoxInfo> getBoxBindListByCode(BmQrBoxInfo bmQrBoxInfo);
|
||||
|
||||
/**
|
||||
* 删除二维码标准箱绑定关系
|
||||
* @param record
|
||||
* @return
|
||||
*/
|
||||
int deleteBoxBind(LeaseOutDetails record);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,4 +83,11 @@ public interface BmQrBoxService {
|
|||
* 查询二维码标准箱详情列表
|
||||
*/
|
||||
List<BmQrBoxInfo> getList(BmQrBoxInfo bmQrBoxInfo);
|
||||
|
||||
/**
|
||||
* app出库查询标准箱绑定详情
|
||||
* @param bmQrBoxInfo
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getBoxBindListByCode(BmQrBoxInfo bmQrBoxInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.basic.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.bonus.common.biz.config.BackstageApplication;
|
||||
import com.bonus.common.biz.config.DateTimeHelper;
|
||||
import com.bonus.common.biz.config.QrCodeUtils;
|
||||
|
|
@ -24,9 +25,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Author ma_sh
|
||||
|
|
@ -351,4 +350,35 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
|
|||
public List<BmQrBoxInfo> getList(BmQrBoxInfo bmQrBoxInfo) {
|
||||
return bmQrBoxMapper.getList(bmQrBoxInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* app出库查询标准箱绑定详情
|
||||
* @param bmQrBoxInfo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getBoxBindListByCode(BmQrBoxInfo bmQrBoxInfo) {
|
||||
if (bmQrBoxInfo.getBoxCode() == null || bmQrBoxInfo.getMaTypeId() == null) {
|
||||
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "标准箱编码或机具类型id不能为空");
|
||||
}
|
||||
List<BmQrBoxInfo> recordList = bmQrBoxMapper.getBoxBindListByCode(bmQrBoxInfo);
|
||||
int num = 0;
|
||||
String msg = "";
|
||||
if (CollectionUtil.isNotEmpty(recordList)) {
|
||||
for (BmQrBoxInfo qrBoxInfo : recordList) {
|
||||
if (qrBoxInfo.getMaStatus().equals(MaMachineStatusEnum.IN_STORE.getStatus().toString())) {
|
||||
num ++;
|
||||
}
|
||||
}
|
||||
msg = "监测到" + bmQrBoxInfo.getBoxCode() + "标准箱中有" + recordList.size()
|
||||
+ "台设备,符合出库条件设备" + num + "台,请确认是否出库!";
|
||||
} else {
|
||||
msg = "监测到" + bmQrBoxInfo.getBoxCode() + "标准箱中无符合出库条件的设备,请检查后重新提交!";
|
||||
}
|
||||
// 返回包含设备列表和消息的结果
|
||||
Map<String, Object> result = new HashMap<>(2);
|
||||
result.put("recordList", recordList);
|
||||
result.put("msg", msg);
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import java.math.BigDecimal;
|
|||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import com.bonus.common.biz.constant.MaterialConstants;
|
||||
import com.bonus.common.biz.enums.InputOutEnum;
|
||||
import com.bonus.common.biz.enums.LeaseTaskStatusEnum;
|
||||
import com.bonus.common.biz.enums.MaMachineStatusEnum;
|
||||
import com.bonus.common.biz.enums.MaTypeManageTypeEnum;
|
||||
|
|
@ -13,6 +14,7 @@ import com.bonus.common.core.utils.StringUtils;
|
|||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.basic.mapper.BmAgreementInfoMapper;
|
||||
import com.bonus.material.basic.mapper.BmQrBoxMapper;
|
||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||
import com.bonus.material.lease.mapper.LeaseApplyDetailsMapper;
|
||||
import com.bonus.material.lease.mapper.LeaseApplyInfoMapper;
|
||||
|
|
@ -31,6 +33,8 @@ import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
|||
import com.bonus.material.lease.service.ILeaseOutDetailsService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 领料出库详细Service业务层处理
|
||||
*
|
||||
|
|
@ -66,6 +70,9 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
|||
|
||||
@Autowired
|
||||
TmTaskAgreementMapper tmTaskAgreementMapper;
|
||||
|
||||
@Resource
|
||||
private BmQrBoxMapper bmQrBoxMapper;
|
||||
/**
|
||||
* 查询领料出库详细
|
||||
*
|
||||
|
|
@ -160,6 +167,12 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
|||
if (isEnough) {
|
||||
if ((record.getManageType().equals(MaTypeManageTypeEnum.NUMBER_DEVICE.getTypeId())) && record.getInputNum() != null) {
|
||||
record.setOutNum(record.getInputNum());
|
||||
record.setOutType(InputOutEnum.NUMBER_DEVICE.getTypeId().toString());
|
||||
} else if (record.getManageType().equals(MaTypeManageTypeEnum.CODE_DEVICE.getTypeId())) {
|
||||
record.setOutType(InputOutEnum.CODE_DEVICE.getTypeId().toString());
|
||||
} else if (record.getManageType().equals(InputOutEnum.STANDARD_BOX.getTypeId())) {
|
||||
// 标准箱
|
||||
record.setOutType(InputOutEnum.STANDARD_BOX.getTypeId().toString());
|
||||
}
|
||||
|
||||
res = checkStorageNum(record);
|
||||
|
|
@ -181,6 +194,13 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
|||
if (res == 0) {
|
||||
throw new RuntimeException("出库失败,插入结算记录失败");
|
||||
}
|
||||
if (record.getManageType().equals(InputOutEnum.STANDARD_BOX.getTypeId())) {
|
||||
// 6、如果标准箱入库,需要将设备从标准箱移出
|
||||
res = updateBoxBind(record);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("出库失败,移出设备失败");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return AjaxResult.error("领料出库失败,机具库存不足");
|
||||
}
|
||||
|
|
@ -194,6 +214,15 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
|||
return AjaxResult.success("出库成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 标准箱移出设备
|
||||
* @param record
|
||||
* @return
|
||||
*/
|
||||
private int updateBoxBind(LeaseOutDetails record) {
|
||||
return bmQrBoxMapper.deleteBoxBind(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询操作前后库存
|
||||
* @param record
|
||||
|
|
|
|||
|
|
@ -65,4 +65,11 @@ public interface PurchaseStorageMapper {
|
|||
* @return
|
||||
*/
|
||||
List<PurchaseVo> select(String taskId);
|
||||
|
||||
/**
|
||||
* 更新机具入库状态
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
int updateMachineByCode(PurchaseDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.bonus.common.security.utils.SecurityUtils;
|
|||
import com.bonus.material.purchase.config.RemoteConfig;
|
||||
import com.bonus.common.biz.domain.purchase.PurchaseDto;
|
||||
import com.bonus.material.purchase.mapper.PurchaseBindMapper;
|
||||
import com.bonus.material.purchase.mapper.PurchaseStorageMapper;
|
||||
import com.bonus.material.purchase.service.IPurchaseBindService;
|
||||
import com.bonus.material.purchase.domain.vo.PurchaseVo;
|
||||
import com.bonus.material.task.mapper.TmTaskMapper;
|
||||
|
|
@ -42,10 +43,10 @@ public class PurchaseBindServiceImpl implements IPurchaseBindService {
|
|||
private PurchaseBindMapper purchaseBindMapper;
|
||||
|
||||
@Resource
|
||||
private TmTaskMapper tmTaskMapper;
|
||||
private RemoteConfig remoteConfig;
|
||||
|
||||
@Resource
|
||||
private RemoteConfig remoteConfig;
|
||||
private PurchaseStorageMapper purchaseStorageMapper;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -144,6 +145,7 @@ public class PurchaseBindServiceImpl implements IPurchaseBindService {
|
|||
purchaseDto.setTypeId(dto.getTypeId());
|
||||
purchaseDto.setStatus(0);
|
||||
result += purchaseBindMapper.add(purchaseDto);
|
||||
result += purchaseStorageMapper.insertMachine(dto);
|
||||
}
|
||||
//根据前端传参更新绑定数量
|
||||
result += purchaseBindMapper.updateNum(dto, dto.getDtoList().size());
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService {
|
|||
}
|
||||
}
|
||||
dto.setTypeId(purchaseDto.getTypeId());
|
||||
result += purchaseStorageMapper.insertMachine(dto);
|
||||
result += purchaseStorageMapper.updateMachineByCode(dto);
|
||||
purchaseStorageMapper.updateStorageNum(BigDecimal.ONE, dto.getTypeId());
|
||||
List<PurchaseCheckDetails> list = purchaseBindMapper.getMachineById(purchaseDto);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
|
|
|
|||
|
|
@ -139,6 +139,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBoxBind">
|
||||
delete
|
||||
from bm_qrcode_box_bind
|
||||
where box_id = #{boxId}
|
||||
and ma_id = #{maId}
|
||||
</delete>
|
||||
|
||||
<insert id="addQrcodeBoxBind">
|
||||
insert into bm_qrcode_box_bind
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -190,4 +197,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
qb.box_id = #{boxId}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getBoxBindListByCode" resultType="com.bonus.material.basic.domain.BmQrBoxInfo">
|
||||
SELECT qb.id as id,
|
||||
qb.box_id as boxId,
|
||||
qb.create_by as createBy,
|
||||
qb.create_time as createTime,
|
||||
mt1.type_name as typeName,
|
||||
mt.type_name as typeModelName,
|
||||
mm.ma_id as maId,
|
||||
mm.ma_code as maCode,
|
||||
mm.type_id as maTypeId,
|
||||
mm.ma_status as maStatus
|
||||
FROM bm_qrcode_box_bind qb
|
||||
LEFT JOIN ma_machine mm ON qb.ma_id = mm.ma_id
|
||||
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id AND mt.del_flag = '0'
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id AND mt1.del_flag = '0'
|
||||
LEFT JOIN bm_qrcode_box bqb ON qb.box_id = bqb.box_id
|
||||
where
|
||||
bqb.box_code = #{boxCode} AND
|
||||
mt.type_id = #{maTypeId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -170,8 +170,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
baif.back_person AS backMan,
|
||||
bcd.create_time AS backDate,
|
||||
CASE
|
||||
WHEN baif.back_person IS NULL THEN '已退'
|
||||
ELSE '在用'
|
||||
WHEN baif.back_person IS NULL THEN '在用'
|
||||
ELSE '已退'
|
||||
END AS statusName
|
||||
FROM
|
||||
lease_out_details lod
|
||||
|
|
@ -219,15 +219,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="statusName != null and statusName != ''">
|
||||
AND (
|
||||
CASE
|
||||
WHEN baif.back_person IS NULL THEN '已退'
|
||||
ELSE '在用'
|
||||
WHEN baif.back_person IS NULL THEN '在用'
|
||||
ELSE '已退'
|
||||
END = #{statusName}
|
||||
)
|
||||
</if>
|
||||
GROUP BY
|
||||
mm.ma_code
|
||||
ORDER BY
|
||||
bai.agreement_code
|
||||
bai.agreement_code,lod.id
|
||||
</select>
|
||||
|
||||
<select id="getInputRecordList" resultType="com.bonus.material.basic.domain.InputRecordInfo">
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="typeId != null">#{typeId},</if>
|
||||
<if test="maCode != null">#{maCode},</if>
|
||||
1,
|
||||
0,
|
||||
<if test="qrCode != null">#{qrCode},</if>
|
||||
<if test="productDate != null">#{productDate},</if>
|
||||
<if test="outFacCode != null">#{outFacCode},</if>
|
||||
|
|
@ -48,6 +48,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
type_id = #{typeId}
|
||||
</update>
|
||||
|
||||
<update id="updateMachineByCode">
|
||||
UPDATE ma_machine
|
||||
SET ma_status = 1
|
||||
WHERE
|
||||
ma_code = #{maCode}
|
||||
and type_id = #{typeId}
|
||||
</update>
|
||||
|
||||
<select id="selectAll" resultType="com.bonus.material.purchase.domain.vo.PurchaseVo">
|
||||
SELECT
|
||||
pci.task_id as taskId,
|
||||
|
|
|
|||
Loading…
Reference in New Issue