二级库功能完善、报废功能开发
This commit is contained in:
parent
e502bc2fbf
commit
af5ef30887
|
|
@ -150,8 +150,7 @@ public class SecondaryWarehouseController extends BaseController {
|
||||||
@ApiOperation(value = "二级库报废申请")
|
@ApiOperation(value = "二级库报废申请")
|
||||||
@PostMapping("/seconfScrap")
|
@PostMapping("/seconfScrap")
|
||||||
public AjaxResult seconfScrap(@RequestBody SecondCcrapApplyDetails bean) {
|
public AjaxResult seconfScrap(@RequestBody SecondCcrapApplyDetails bean) {
|
||||||
Integer i = service.seconfScrap(bean);
|
return service.seconfScrap(bean);
|
||||||
return toAjax(i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "二级库报废审核(通过/驳回)")
|
@ApiOperation(value = "二级库报废审核(通过/驳回)")
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.bonus.sgzb.material.domain;
|
package com.bonus.sgzb.material.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -31,6 +33,8 @@ public class SecondCcrapApplyDetails {
|
||||||
// 创建者
|
// 创建者
|
||||||
private String createBy;
|
private String createBy;
|
||||||
// 创建时间
|
// 创建时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
// 更新者
|
// 更新者
|
||||||
private String updateBy;
|
private String updateBy;
|
||||||
|
|
@ -45,4 +49,7 @@ public class SecondCcrapApplyDetails {
|
||||||
private String unitName;
|
private String unitName;
|
||||||
private String modelName;
|
private String modelName;
|
||||||
private String typeName;
|
private String typeName;
|
||||||
|
private String maCode;
|
||||||
|
private Long deptId;
|
||||||
|
private Integer parentId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,4 +23,6 @@ public class SecondLotConfig {
|
||||||
private String updater;
|
private String updater;
|
||||||
//修改时间
|
//修改时间
|
||||||
private String updateTime;
|
private String updateTime;
|
||||||
|
// 部门id
|
||||||
|
private Long deptId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ public class SecondaryWarehouse {
|
||||||
*机具id
|
*机具id
|
||||||
*/
|
*/
|
||||||
private String maId;
|
private String maId;
|
||||||
|
private Long deptId;
|
||||||
/**
|
/**
|
||||||
*机具id
|
*机具id
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -23,4 +23,6 @@ public class TeamGroup {
|
||||||
private String updater;
|
private String updater;
|
||||||
//修改时间
|
//修改时间
|
||||||
private String updateTime;
|
private String updateTime;
|
||||||
|
|
||||||
|
private Long deptId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ public class TeamLeaseInfo {
|
||||||
*/
|
*/
|
||||||
private String queryType;
|
private String queryType;
|
||||||
|
|
||||||
private int outNum;
|
private Integer outNum;
|
||||||
private Integer teamGroupId;
|
private Integer teamGroupId;
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
|
|
||||||
|
|
@ -93,4 +93,6 @@ public interface SecondaryWarehouseMapper {
|
||||||
Integer updateDevNum(SecondCcrapApplyDetails secondCcrapApplyDetails);
|
Integer updateDevNum(SecondCcrapApplyDetails secondCcrapApplyDetails);
|
||||||
|
|
||||||
List<SecondCcrapApplyDetails> getSecondScrapListDetails(SecondCcrapApplyDetails bean);
|
List<SecondCcrapApplyDetails> getSecondScrapListDetails(SecondCcrapApplyDetails bean);
|
||||||
|
|
||||||
|
List<SecondCcrapApplyDetails> getSecondScrapByMaId(@Param("maId") String maId, @Param("typeId") String typeId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ public interface SecondaryWarehouseService {
|
||||||
|
|
||||||
List<SecondCcrapApplyDetails> getSecondScrapList(SecondCcrapApplyDetails bean);
|
List<SecondCcrapApplyDetails> getSecondScrapList(SecondCcrapApplyDetails bean);
|
||||||
|
|
||||||
Integer seconfScrap(SecondCcrapApplyDetails bean);
|
AjaxResult seconfScrap(SecondCcrapApplyDetails bean);
|
||||||
|
|
||||||
Integer auditSeconfScrap(SecondCcrapApplyDetails bean);
|
Integer auditSeconfScrap(SecondCcrapApplyDetails bean);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,11 +94,17 @@ public class SecondaryWarehouseServiceImpl implements SecondaryWarehouseService
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SecondLotConfig> listConfig(SecondLotConfig bean) {
|
public List<SecondLotConfig> listConfig(SecondLotConfig bean) {
|
||||||
|
if (!SecurityUtils.getLoginUser().getRoles().contains("admin")) {
|
||||||
|
bean.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId());
|
||||||
|
}
|
||||||
return mapper.listConfig(bean);
|
return mapper.listConfig(bean);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TeamGroup> listTeamGroup(TeamGroup bean) {
|
public List<TeamGroup> listTeamGroup(TeamGroup bean) {
|
||||||
|
if (!SecurityUtils.getLoginUser().getRoles().contains("admin")) {
|
||||||
|
bean.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId());
|
||||||
|
}
|
||||||
return mapper.listTeamGroup(bean);
|
return mapper.listTeamGroup(bean);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -150,25 +156,35 @@ public class SecondaryWarehouseServiceImpl implements SecondaryWarehouseService
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MaMachine> getDevStockCount(SecondaryWarehouse bean) {
|
public List<MaMachine> getDevStockCount(SecondaryWarehouse bean) {
|
||||||
|
if (!SecurityUtils.getLoginUser().getRoles().contains("admin")) {
|
||||||
|
bean.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId());
|
||||||
|
}
|
||||||
return mapper.getDevStockCount(bean);
|
return mapper.getDevStockCount(bean);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SecondCcrapApplyDetails> getSecondScrapList(SecondCcrapApplyDetails bean) {
|
public List<SecondCcrapApplyDetails> getSecondScrapList(SecondCcrapApplyDetails bean) {
|
||||||
|
if (!SecurityUtils.getLoginUser().getRoles().contains("admin")) {
|
||||||
|
bean.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId());
|
||||||
|
}
|
||||||
return mapper.getSecondScrapList(bean);
|
return mapper.getSecondScrapList(bean);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer seconfScrap(SecondCcrapApplyDetails teamLeaseInfo) {
|
public AjaxResult seconfScrap(SecondCcrapApplyDetails teamLeaseInfo) {
|
||||||
teamLeaseInfo.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
teamLeaseInfo.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||||
Integer num = 0;
|
|
||||||
String code = "BF" + System.currentTimeMillis();
|
String code = "BF" + System.currentTimeMillis();
|
||||||
if (teamLeaseInfo.getTeamLeaseInfos().size() > 0) {
|
if (teamLeaseInfo.getTeamLeaseInfos().size() > 0) {
|
||||||
num = 0;
|
Integer num = 0;
|
||||||
for (TeamLeaseInfo bean : teamLeaseInfo.getTeamLeaseInfos()) {
|
for (TeamLeaseInfo bean : teamLeaseInfo.getTeamLeaseInfos()) {
|
||||||
// 编码设备
|
// 编码设备
|
||||||
if (StringUtils.isNotBlank(bean.getMaIds())) {
|
if (StringUtils.isNotBlank(bean.getMaIds())) {
|
||||||
for (String maId : bean.getMaIds().split(",")) {
|
for (String maId : bean.getMaIds().split(",")) {
|
||||||
|
// 先查询是否已经申请了报废
|
||||||
|
List<SecondCcrapApplyDetails> list = mapper.getSecondScrapByMaId(maId, bean.getTypeId());
|
||||||
|
if (list.size() > 0) {
|
||||||
|
return AjaxResult.error(list.get(0).getMaCode() + "已申请报废,请勿重复申请");
|
||||||
|
}
|
||||||
// 出库
|
// 出库
|
||||||
teamLeaseInfo.setMaId(maId);
|
teamLeaseInfo.setMaId(maId);
|
||||||
teamLeaseInfo.setTypeId(bean.getTypeId());
|
teamLeaseInfo.setTypeId(bean.getTypeId());
|
||||||
|
|
@ -176,7 +192,8 @@ public class SecondaryWarehouseServiceImpl implements SecondaryWarehouseService
|
||||||
teamLeaseInfo.setCode(code);
|
teamLeaseInfo.setCode(code);
|
||||||
teamLeaseInfo.setStatus(0);
|
teamLeaseInfo.setStatus(0);
|
||||||
teamLeaseInfo.setAuditRemark(bean.getAuditRemark());
|
teamLeaseInfo.setAuditRemark(bean.getAuditRemark());
|
||||||
num = mapper.secondScrapApplyDetails(teamLeaseInfo);
|
teamLeaseInfo.setId(bean.getId().intValue());
|
||||||
|
num += mapper.secondScrapApplyDetails(teamLeaseInfo);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 数量设备
|
// 数量设备
|
||||||
|
|
@ -186,17 +203,25 @@ public class SecondaryWarehouseServiceImpl implements SecondaryWarehouseService
|
||||||
teamLeaseInfo.setCode(code);
|
teamLeaseInfo.setCode(code);
|
||||||
teamLeaseInfo.setStatus(0);
|
teamLeaseInfo.setStatus(0);
|
||||||
teamLeaseInfo.setAuditRemark(bean.getAuditRemark());
|
teamLeaseInfo.setAuditRemark(bean.getAuditRemark());
|
||||||
num = mapper.secondScrapApplyDetails(teamLeaseInfo);
|
teamLeaseInfo.setId(bean.getId().intValue());
|
||||||
|
num += mapper.secondScrapApplyDetails(teamLeaseInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (num > 0) {
|
||||||
|
return AjaxResult.success("申请成功");
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error("申请失败");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error("参数为空");
|
||||||
}
|
}
|
||||||
return num;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer auditSeconfScrap(SecondCcrapApplyDetails bean) {
|
public Integer auditSeconfScrap(SecondCcrapApplyDetails bean) {
|
||||||
// 目前先做成统一审核,后续如果需要对不同机具单独审核在做修改
|
// 目前先做成统一审核,后续如果需要对不同机具单独审核在做修改
|
||||||
int num = 0;
|
int num = 0;
|
||||||
|
bean.setAuditBy(SecurityUtils.getLoginUser().getUserid().intValue());
|
||||||
if (bean.getStatus() == 1) {
|
if (bean.getStatus() == 1) {
|
||||||
//同意
|
//同意
|
||||||
num = mapper.auditSeconfScrap(bean);
|
num = mapper.auditSeconfScrap(bean);
|
||||||
|
|
@ -205,9 +230,22 @@ public class SecondaryWarehouseServiceImpl implements SecondaryWarehouseService
|
||||||
List<SecondCcrapApplyDetails> list = mapper.getSeconfScrapByCode(bean);
|
List<SecondCcrapApplyDetails> list = mapper.getSeconfScrapByCode(bean);
|
||||||
for (SecondCcrapApplyDetails secondCcrapApplyDetails : list) {
|
for (SecondCcrapApplyDetails secondCcrapApplyDetails : list) {
|
||||||
if (StringUtils.isNotBlank(secondCcrapApplyDetails.getMaId())) {
|
if (StringUtils.isNotBlank(secondCcrapApplyDetails.getMaId())) {
|
||||||
|
// 修改机具状态为报废
|
||||||
mapper.updateMaMachineStatus(secondCcrapApplyDetails.getMaId());
|
mapper.updateMaMachineStatus(secondCcrapApplyDetails.getMaId());
|
||||||
|
// 更新设备出库数量库存
|
||||||
|
TeamLeaseInfo teamLeaseInfo = new TeamLeaseInfo();
|
||||||
|
teamLeaseInfo.setId(secondCcrapApplyDetails.getParentId().longValue());
|
||||||
|
teamLeaseInfo.setMaId(secondCcrapApplyDetails.getMaId());
|
||||||
|
mapper.deleteOutNum(teamLeaseInfo);
|
||||||
} else {
|
} else {
|
||||||
|
// 更新设备库存
|
||||||
mapper.updateDevNum(secondCcrapApplyDetails);
|
mapper.updateDevNum(secondCcrapApplyDetails);
|
||||||
|
// 更新设备出库数量库存
|
||||||
|
TeamLeaseInfo teamLeaseInfo = new TeamLeaseInfo();
|
||||||
|
teamLeaseInfo.setParentId(secondCcrapApplyDetails.getParentId());
|
||||||
|
teamLeaseInfo.setOutNum(secondCcrapApplyDetails.getScrapNum());
|
||||||
|
teamLeaseInfo.setTypeId(secondCcrapApplyDetails.getTypeId());
|
||||||
|
mapper.updateOutNum(teamLeaseInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -226,6 +264,9 @@ public class SecondaryWarehouseServiceImpl implements SecondaryWarehouseService
|
||||||
@Override
|
@Override
|
||||||
public List<SecondaryWarehouse> getList(SecondaryWarehouse bean) {
|
public List<SecondaryWarehouse> getList(SecondaryWarehouse bean) {
|
||||||
bean.setLeaseType(1);
|
bean.setLeaseType(1);
|
||||||
|
if (!SecurityUtils.getLoginUser().getRoles().contains("admin")) {
|
||||||
|
bean.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId());
|
||||||
|
}
|
||||||
List<SecondaryWarehouse> list = mapper.getList(bean);
|
List<SecondaryWarehouse> list = mapper.getList(bean);
|
||||||
for (SecondaryWarehouse secondaryWarehouse : list) {
|
for (SecondaryWarehouse secondaryWarehouse : list) {
|
||||||
Integer warehouse = mapper.selectStockNum(secondaryWarehouse);
|
Integer warehouse = mapper.selectStockNum(secondaryWarehouse);
|
||||||
|
|
@ -302,6 +343,7 @@ public class SecondaryWarehouseServiceImpl implements SecondaryWarehouseService
|
||||||
teamLeaseInfo.setOutNum(bean.getOutNum());
|
teamLeaseInfo.setOutNum(bean.getOutNum());
|
||||||
teamLeaseInfo.setTypeId(bean.getTypeId());
|
teamLeaseInfo.setTypeId(bean.getTypeId());
|
||||||
teamLeaseInfo.setId(bean.getId());
|
teamLeaseInfo.setId(bean.getId());
|
||||||
|
teamLeaseInfo.setParentId(bean.getId().intValue());
|
||||||
teamLeaseInfo.setMaId(null);
|
teamLeaseInfo.setMaId(null);
|
||||||
num = mapper.addNewOperate(teamLeaseInfo);
|
num = mapper.addNewOperate(teamLeaseInfo);
|
||||||
if (teamLeaseInfo.getType() == 3) {
|
if (teamLeaseInfo.getType() == 3) {
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
parent_id = #{parentId} and type_id = #{typeId}
|
parent_id = #{parentId} and type_id = #{typeId}
|
||||||
</update>
|
</update>
|
||||||
<update id="auditSeconfScrap">
|
<update id="auditSeconfScrap">
|
||||||
UPDATE second_ccrap_apply_details
|
UPDATE second_scrap_apply_details
|
||||||
SET
|
SET
|
||||||
audit_by = #{auditBy},
|
audit_by = #{auditBy},
|
||||||
audit_time = now(),
|
audit_time = now(),
|
||||||
|
|
@ -97,6 +97,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="leaseType != null">
|
<if test="leaseType != null">
|
||||||
and lai.lease_type = #{leaseType}
|
and lai.lease_type = #{leaseType}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="deptId != null">
|
||||||
|
and bui.dept_id = #{deptId}
|
||||||
|
</if>
|
||||||
<if test="keyword != null and keyword != ''">
|
<if test="keyword != null and keyword != ''">
|
||||||
and (bui.unit_name like concat('%', #{keyword}, '%') or
|
and (bui.unit_name like concat('%', #{keyword}, '%') or
|
||||||
mt1.type_name like concat('%', #{keyword}, '%') or
|
mt1.type_name like concat('%', #{keyword}, '%') or
|
||||||
|
|
@ -105,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</if>
|
</if>
|
||||||
GROUP BY
|
GROUP BY
|
||||||
bui.unit_id,
|
bui.unit_id,
|
||||||
|
lod.parent_id,
|
||||||
lod.type_id
|
lod.type_id
|
||||||
</select>
|
</select>
|
||||||
<select id="getList1" resultType="com.bonus.sgzb.material.domain.SecondaryWarehouse">
|
<select id="getList1" resultType="com.bonus.sgzb.material.domain.SecondaryWarehouse">
|
||||||
|
|
@ -389,6 +393,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="unitId != null">
|
<if test="unitId != null">
|
||||||
and slc.unit_id = #{unitId}
|
and slc.unit_id = #{unitId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="deptId != null">
|
||||||
|
and bui.dept_id = #{deptId}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="listTeamGroup" resultType="com.bonus.sgzb.material.domain.TeamGroup">
|
<select id="listTeamGroup" resultType="com.bonus.sgzb.material.domain.TeamGroup">
|
||||||
|
|
@ -401,6 +408,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="unitId != null">
|
<if test="unitId != null">
|
||||||
and tg.unit_id = #{unitId}
|
and tg.unit_id = #{unitId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="deptId != null">
|
||||||
|
and bui.dept_id = #{deptId}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="getMaStatusByMaId" resultType="com.bonus.sgzb.base.api.domain.MaMachine">
|
<select id="getMaStatusByMaId" resultType="com.bonus.sgzb.base.api.domain.MaMachine">
|
||||||
|
|
@ -554,9 +564,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
LEFT JOIN ma_machine mm ON rd.ma_id = mm.ma_id
|
LEFT JOIN ma_machine mm ON rd.ma_id = mm.ma_id
|
||||||
LEFT JOIN team_group tg ON rd.team_group_id = tg.id
|
LEFT JOIN team_group tg ON rd.team_group_id = tg.id
|
||||||
LEFT JOIN second_lot_config slc ON rd.unit_id = slc.unit_id
|
LEFT JOIN second_lot_config slc ON rd.unit_id = slc.unit_id
|
||||||
|
LEFT JOIN bm_unit_info bui on bui.unit_id = rd.unit_id
|
||||||
LEFT JOIN ma_type mt ON mt.type_id = mm.type_id
|
LEFT JOIN ma_type mt ON mt.type_id = mm.type_id
|
||||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||||
WHERE mm.ma_status = 132
|
WHERE mm.ma_status = 132
|
||||||
|
<if test="deptId != null">
|
||||||
|
AND bui.dept_id = #{deptId}
|
||||||
|
</if>
|
||||||
<if test="keyword != null and keyword != ''">
|
<if test="keyword != null and keyword != ''">
|
||||||
AND tg.NAME like concat('%', #{keyword}, '%')
|
AND tg.NAME like concat('%', #{keyword}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -580,6 +594,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
FROM receive_detail rd
|
FROM receive_detail rd
|
||||||
LEFT JOIN team_group tg ON rd.team_group_id = tg.id
|
LEFT JOIN team_group tg ON rd.team_group_id = tg.id
|
||||||
LEFT JOIN second_lot_config slc ON rd.unit_id = slc.unit_id
|
LEFT JOIN second_lot_config slc ON rd.unit_id = slc.unit_id
|
||||||
|
LEFT JOIN bm_unit_info bui on bui.unit_id = rd.unit_id
|
||||||
LEFT JOIN ma_type mt ON mt.type_id = rd.type_id
|
LEFT JOIN ma_type mt ON mt.type_id = rd.type_id
|
||||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||||
WHERE rd.type IN ('1', '2')
|
WHERE rd.type IN ('1', '2')
|
||||||
|
|
@ -587,6 +602,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="unitId != null">
|
<if test="unitId != null">
|
||||||
AND rd.unit_id = #{unitId}
|
AND rd.unit_id = #{unitId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="deptId != null">
|
||||||
|
AND bui.dept_id = #{deptId}
|
||||||
|
</if>
|
||||||
<if test="keyword != null and keyword != ''">
|
<if test="keyword != null and keyword != ''">
|
||||||
AND tg.NAME like concat('%', #{keyword}, '%')
|
AND tg.NAME like concat('%', #{keyword}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -622,10 +640,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
FROM
|
FROM
|
||||||
second_scrap_apply_details ssd
|
second_scrap_apply_details ssd
|
||||||
LEFT JOIN second_lot_config slc ON ssd.unit_id = slc.unit_id
|
LEFT JOIN second_lot_config slc ON ssd.unit_id = slc.unit_id
|
||||||
|
left join bm_unit_info bui on bui.unit_id = slc.unit_id
|
||||||
where 1=1
|
where 1=1
|
||||||
<if test="unitId != null">
|
<if test="unitId != null">
|
||||||
AND ssd.unit_id = #{unitId}
|
AND ssd.unit_id = #{unitId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="deptId != null">
|
||||||
|
AND bui.dept_id = #{deptId}
|
||||||
|
</if>
|
||||||
<if test="code != null and code !=''">
|
<if test="code != null and code !=''">
|
||||||
AND ssd.code like concat('%', #{code}, '%')
|
AND ssd.code like concat('%', #{code}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -639,14 +661,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
select
|
select
|
||||||
ssd.*,
|
ssd.*,
|
||||||
mt.type_name AS modelName,
|
mt.type_name AS modelName,
|
||||||
|
mm.ma_code AS maCode,
|
||||||
mt2.type_name AS typeName
|
mt2.type_name AS typeName
|
||||||
from
|
from
|
||||||
second_scrap_apply_details ssd
|
second_scrap_apply_details ssd
|
||||||
left join ma_type mt on ssd.type_id = mt.type_id
|
left join ma_type mt on ssd.type_id = mt.type_id
|
||||||
left join ma_type mt2 on mt.parent_id = mt2.type_id
|
left join ma_type mt2 on mt.parent_id = mt2.type_id
|
||||||
|
left join ma_machine mm on ssd.ma_id = mm.ma_id
|
||||||
where
|
where
|
||||||
ssd.code = #{code}
|
ssd.code = #{code}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getSecondScrapByMaId" resultType="com.bonus.sgzb.material.domain.SecondCcrapApplyDetails">
|
||||||
|
select mm.ma_code from second_scrap_apply_details ssd
|
||||||
|
left join ma_machine mm on ssd.ma_id = mm.ma_id
|
||||||
|
where ssd.ma_id = #{maId} and ssd.type_id = #{typeId} and ssd.status in (0,1)
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="addConfig">
|
<insert id="addConfig">
|
||||||
insert into second_lot_config (name,unit_id,creater,create_time)
|
insert into second_lot_config (name,unit_id,creater,create_time)
|
||||||
|
|
@ -664,7 +693,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
update ma_type set num = num + #{outNum} where type_id = #{typeId}
|
update ma_type set num = num + #{outNum} where type_id = #{typeId}
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="secondScrapApplyDetails">
|
<insert id="secondScrapApplyDetails">
|
||||||
insert into second_scrap_apply_details (code,ma_id,type_id,scrap_num,create_by,create_time,unit_id,status,audit_remark)
|
insert into second_scrap_apply_details (code,ma_id,type_id,scrap_num,create_by,create_time,unit_id,status,audit_remark,parent_id)
|
||||||
values (#{code},#{maId},#{typeId},#{scrapNum},#{createBy},now(),#{unitId},#{status},#{auditRemark});
|
values (#{code},#{maId},#{typeId},#{scrapNum},#{createBy},now(),#{unitId},#{status},#{auditRemark},#{id});
|
||||||
</insert>
|
</insert>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue