领料流程修改
This commit is contained in:
parent
6c86a132be
commit
15798022e3
@ -124,4 +124,7 @@ public class DlRepairSo extends TenantBaseDO {
|
|||||||
*/
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String licenseNumber;
|
private String licenseNumber;
|
||||||
|
|
||||||
|
/** 用户记录那些人可以看这条记录 */
|
||||||
|
private String userIds;
|
||||||
}
|
}
|
@ -50,6 +50,7 @@ import java.util.function.Function;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 针对表【dl_repair_so(采购单领料单)】的数据库操作Service实现
|
* 针对表【dl_repair_so(采购单领料单)】的数据库操作Service实现
|
||||||
@ -218,7 +219,16 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
|||||||
@Override
|
@Override
|
||||||
@DSTransactional
|
@DSTransactional
|
||||||
public void voidRepairSo(DlRepairSoReqVO repairSoReqVO) {
|
public void voidRepairSo(DlRepairSoReqVO repairSoReqVO) {
|
||||||
baseMapper.updateById(repairSoReqVO);
|
int update = baseMapper.update(new LambdaUpdateWrapper<DlRepairSo>()
|
||||||
|
.set(DlRepairSo::getSoStatus, SoStatusEnum.DEPRECATED.getCode())
|
||||||
|
.and(i ->
|
||||||
|
i.eq(DlRepairSo::getId, repairSoReqVO.getId())
|
||||||
|
.ne(DlRepairSo::getSoStatus, SoStatusEnum.DEPRECATED.getCode())
|
||||||
|
.ne(DlRepairSo::getSoStatus, SoStatusEnum.PICKED.getCode())
|
||||||
|
));
|
||||||
|
if (update == 0) {
|
||||||
|
throw exception0(500, "该单据已有其他人操作");
|
||||||
|
}
|
||||||
|
|
||||||
// 下面的代码是因为这个接口还有地方在用
|
// 下面的代码是因为这个接口还有地方在用
|
||||||
// 查主表
|
// 查主表
|
||||||
@ -325,11 +335,22 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
|||||||
@Override
|
@Override
|
||||||
@DSTransactional
|
@DSTransactional
|
||||||
public void confirmGet(String id, String image) {
|
public void confirmGet(String id, String image) {
|
||||||
// 更新主表状态 为已领料
|
// 更新主表状态 为已领料 需要判断是否已经领料过了
|
||||||
DlRepairSo dlRepairSo = new DlRepairSo();
|
int update = baseMapper.update(new LambdaUpdateWrapper<DlRepairSo>()
|
||||||
dlRepairSo.setId(id);
|
.set(DlRepairSo::getSoStatus, SoStatusEnum.PICKED.getCode())
|
||||||
dlRepairSo.setSoStatus(SoStatusEnum.PICKED.getCode());
|
.and(i -> {
|
||||||
baseMapper.updateById(dlRepairSo);
|
i.eq(DlRepairSo::getId, id)
|
||||||
|
.ne(DlRepairSo::getSoStatus, SoStatusEnum.PICKED.getCode())
|
||||||
|
.ne(DlRepairSo::getSoStatus, SoStatusEnum.DEPRECATED.getCode());
|
||||||
|
})
|
||||||
|
);
|
||||||
|
if (update == 0) {
|
||||||
|
throw exception0(500, "该领料单已有其他人操作");
|
||||||
|
}
|
||||||
|
// DlRepairSo dlRepairSo = new DlRepairSo();
|
||||||
|
// dlRepairSo.setId(id);
|
||||||
|
// dlRepairSo.setSoStatus(SoStatusEnum.PICKED.getCode());
|
||||||
|
// baseMapper.u
|
||||||
|
|
||||||
// 查最新的子表信息
|
// 查最新的子表信息
|
||||||
DlRepairSo so = baseMapper.selectById(id);
|
DlRepairSo so = baseMapper.selectById(id);
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
<result property="updater" column="updater" jdbcType="VARCHAR"/>
|
<result property="updater" column="updater" jdbcType="VARCHAR"/>
|
||||||
<result property="twId" column="tw_id" />
|
<result property="twId" column="tw_id" />
|
||||||
<result property="licenseNumber" column="license_number" />
|
<result property="licenseNumber" column="license_number" />
|
||||||
|
<result property="userIds" column="user_ids" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="Base_SQL">
|
<sql id="Base_SQL">
|
||||||
@ -50,7 +51,8 @@
|
|||||||
so.update_time,
|
so.update_time,
|
||||||
so.updater,
|
so.updater,
|
||||||
so.tw_id,
|
so.tw_id,
|
||||||
dtw.license_number
|
dtw.license_number,
|
||||||
|
so.user_ids
|
||||||
from dl_repair_so so
|
from dl_repair_so so
|
||||||
LEFT JOIN dl_ticket_wares dtw ON so.tw_id = dtw.id
|
LEFT JOIN dl_ticket_wares dtw ON so.tw_id = dtw.id
|
||||||
where so.deleted = '0'
|
where so.deleted = '0'
|
||||||
@ -83,7 +85,7 @@
|
|||||||
and (so.so_no like concat('%', #{map.soNo}, '%') or so.remark like concat('%', #{map.soNo}, '%'))
|
and (so.so_no like concat('%', #{map.soNo}, '%') or so.remark like concat('%', #{map.soNo}, '%'))
|
||||||
</if>
|
</if>
|
||||||
<if test="map.userId != null and map.userId != ''">
|
<if test="map.userId != null and map.userId != ''">
|
||||||
and (so.user_id = #{map.userId})
|
and (so.user_id = #{map.userId} or find_in_set(#{map.userId}, so.user_ids) > 0)
|
||||||
</if>
|
</if>
|
||||||
<if test="map.mainId != null and map.mainId != ''">
|
<if test="map.mainId != null and map.mainId != ''">
|
||||||
and so.main_id = #{map.mainId}
|
and so.main_id = #{map.mainId}
|
||||||
|
Loading…
Reference in New Issue
Block a user