新增条码完整性校验缓存表,关联关系等
parent
f667d9e1c6
commit
731976a40c
@ -0,0 +1,90 @@
|
||||
package com.glxp.api.controller.inout;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.constant.ConstantStatus;
|
||||
import com.glxp.api.controller.BaseController;
|
||||
import com.glxp.api.entity.inout.IoCodeLostEntity;
|
||||
import com.glxp.api.entity.inout.IoCodeTempEntity;
|
||||
import com.glxp.api.req.inout.FilterOrderDetailResultRequest;
|
||||
import com.glxp.api.res.inout.AcceptOrderResponse;
|
||||
import com.glxp.api.res.inout.IoOrderDetailResultResponse;
|
||||
import com.glxp.api.service.inout.IoCodeLostService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class IoCodeLostController extends BaseController {
|
||||
|
||||
|
||||
@Resource
|
||||
IoCodeLostService codeLostService;
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("warehouse/inout/saveTabCode")
|
||||
public BaseResponse saveCode(@RequestBody IoCodeTempEntity codeTempEntity) {
|
||||
|
||||
if (StrUtil.isNotEmpty(codeTempEntity.getSerialNo()) && codeTempEntity.getSerialNo().length() > 20) {
|
||||
return ResultVOUtils.error(500, "无效条码!序列号超出最大范围,不予缓存");
|
||||
}
|
||||
|
||||
if (StrUtil.isNotEmpty(codeTempEntity.getBatchNo()) && codeTempEntity.getBatchNo().length() > 20) {
|
||||
return ResultVOUtils.error(500, "无效条码!批次号超出最大范围,不予缓存");
|
||||
}
|
||||
|
||||
if (StrUtil.isBlank(codeTempEntity.getSerialNo()) && StrUtil.isBlank(codeTempEntity.getBatchNo())) {
|
||||
return ResultVOUtils.error(500, "批次号不能为空!,不予缓存");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(codeTempEntity.getSerialNo())) {
|
||||
return ResultVOUtils.error(500, "有序列号不予缓存");
|
||||
}
|
||||
|
||||
IoCodeLostEntity codeLostEntity = codeLostService.findByCode(codeTempEntity.getCode());
|
||||
IoCodeLostEntity insertEntity = null;
|
||||
if (codeLostEntity == null) {
|
||||
insertEntity = new IoCodeLostEntity();
|
||||
insertEntity.setCreateTime(new Date());
|
||||
} else {
|
||||
insertEntity = codeLostEntity;
|
||||
}
|
||||
insertEntity.setCode(codeTempEntity.getCode());
|
||||
insertEntity.setBatchNo(codeTempEntity.getBatchNo());
|
||||
insertEntity.setProduceDate(codeTempEntity.getProduceDate());
|
||||
insertEntity.setExpireDate(codeTempEntity.getExpireDate());
|
||||
insertEntity.setSerialNo(codeTempEntity.getSerialNo());
|
||||
insertEntity.setSupId(codeTempEntity.getSupId());
|
||||
insertEntity.setUpdateTime(new Date());
|
||||
|
||||
if (codeLostEntity != null) {
|
||||
codeLostService.update(insertEntity);
|
||||
} else {
|
||||
codeLostService.insert(insertEntity);
|
||||
}
|
||||
return ResultVOUtils.success("修改成功!");
|
||||
}
|
||||
|
||||
|
||||
//获取验收单据业务详情
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/warehouse/inout/getTabCode")
|
||||
public BaseResponse getTabCode(String code) {
|
||||
if (StrUtil.isBlank(code)) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
IoCodeLostEntity codeLostEntity = codeLostService.findByCode(code);
|
||||
if (codeLostEntity == null)
|
||||
return ResultVOUtils.error(500, "未缓存!");
|
||||
return ResultVOUtils.success(codeLostEntity);
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.glxp.api.dao.inout;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.api.entity.inout.IoCodeLostEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface IoCodeLostMapper extends BaseMapper<IoCodeLostEntity> {
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.glxp.api.dao.inout;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.api.entity.inout.IoCodeRelEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface IoCodeRelMapper extends BaseMapper<IoCodeRelEntity> {
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
package com.glxp.api.entity.inout;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 扫码缺失字段信息补齐表
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "io_code_lost")
|
||||
public class IoCodeLostEntity {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* UDI码
|
||||
*/
|
||||
@TableField(value = "code")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
@TableField(value = "batchNo")
|
||||
private String batchNo;
|
||||
|
||||
/**
|
||||
* 生产日期
|
||||
*/
|
||||
@TableField(value = "produceDate")
|
||||
private String produceDate;
|
||||
|
||||
/**
|
||||
* 失效日期
|
||||
*/
|
||||
@TableField(value = "expireDate")
|
||||
private String expireDate;
|
||||
|
||||
/**
|
||||
* 序列号
|
||||
*/
|
||||
@TableField(value = "serialNo")
|
||||
private String serialNo;
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
@TableField(value = "supId")
|
||||
private String supId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value = "createTime")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(value = "updateTime")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
|
||||
public static final String COL_ID = "id";
|
||||
|
||||
public static final String COL_CODE = "code";
|
||||
|
||||
public static final String COL_BATCHNO = "batchNo";
|
||||
|
||||
public static final String COL_PRODUCEDATE = "produceDate";
|
||||
|
||||
public static final String COL_EXPIREDATE = "expireDate";
|
||||
|
||||
public static final String COL_SERIALNO = "serialNo";
|
||||
|
||||
public static final String COL_SUPID = "supId";
|
||||
|
||||
public static final String COL_CREATETIME = "createTime";
|
||||
|
||||
public static final String COL_UPDATETIME = "updateTime";
|
||||
|
||||
public static final String COL_REMARK = "remark";
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
package com.glxp.api.entity.inout;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 多级包装关联关系表
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "io_code_rel")
|
||||
public class IoCodeRelEntity {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* UDI码
|
||||
*/
|
||||
@TableField(value = "code")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 父码
|
||||
*/
|
||||
@TableField(value = "parentCode")
|
||||
private String parentCode;
|
||||
|
||||
/**
|
||||
* DI产品标识
|
||||
*/
|
||||
@TableField(value = "nameCode")
|
||||
private String nameCode;
|
||||
|
||||
/**
|
||||
* DI类型
|
||||
*/
|
||||
@TableField(value = "diType")
|
||||
private Byte diType;
|
||||
|
||||
/**
|
||||
* 主产品DI标识
|
||||
*/
|
||||
@TableField(value = "mainNameCode")
|
||||
private String mainNameCode;
|
||||
|
||||
/**
|
||||
* 级别
|
||||
*/
|
||||
@TableField(value = "`level`")
|
||||
private String level;
|
||||
|
||||
/**
|
||||
* 生产日期
|
||||
*/
|
||||
@TableField(value = "produceDate")
|
||||
private String produceDate;
|
||||
|
||||
/**
|
||||
* 失效日期
|
||||
*/
|
||||
@TableField(value = "expireDate")
|
||||
private String expireDate;
|
||||
|
||||
/**
|
||||
* 序列号
|
||||
*/
|
||||
@TableField(value = "serialNo")
|
||||
private String serialNo;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value = "createTime")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(value = "updateTime")
|
||||
private Date updateTime;
|
||||
|
||||
public static final String COL_ID = "id";
|
||||
|
||||
public static final String COL_CODE = "code";
|
||||
|
||||
public static final String COL_PARENTCODE = "parentCode";
|
||||
|
||||
public static final String COL_NAMECODE = "nameCode";
|
||||
|
||||
public static final String COL_DITYPE = "diType";
|
||||
|
||||
public static final String COL_MAINNAMECODE = "mainNameCode";
|
||||
|
||||
public static final String COL_LEVEL = "level";
|
||||
|
||||
public static final String COL_PRODUCEDATE = "produceDate";
|
||||
|
||||
public static final String COL_EXPIREDATE = "expireDate";
|
||||
|
||||
public static final String COL_SERIALNO = "serialNo";
|
||||
|
||||
public static final String COL_CREATETIME = "createTime";
|
||||
|
||||
public static final String COL_UPDATETIME = "updateTime";
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.glxp.api.service.inout;
|
||||
|
||||
import com.glxp.api.entity.inout.IoCodeLostEntity;
|
||||
|
||||
public interface IoCodeLostService {
|
||||
|
||||
IoCodeLostEntity findByCode(String code);
|
||||
|
||||
int insert(IoCodeLostEntity ioCodeLostEntity);
|
||||
|
||||
|
||||
int deleteByCode(String code);
|
||||
|
||||
int update(IoCodeLostEntity ioCodeLostEntity);
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.glxp.api.service.inout;
|
||||
|
||||
import com.glxp.api.entity.inout.IoCodeRelEntity;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
public interface IoCodeRelService {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.glxp.api.service.inout.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.glxp.api.dao.inout.IoCodeLostMapper;
|
||||
import com.glxp.api.entity.inout.IoCodeLostEntity;
|
||||
import com.glxp.api.service.inout.IoCodeLostService;
|
||||
|
||||
@Service
|
||||
public class IoCodeLostServiceImpl implements IoCodeLostService {
|
||||
|
||||
@Resource
|
||||
IoCodeLostMapper codeLostEntityMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public IoCodeLostEntity findByCode(String code) {
|
||||
|
||||
return codeLostEntityMapper.selectOne(new QueryWrapper<IoCodeLostEntity>().eq("code", code));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insert(IoCodeLostEntity ioCodeLostEntity) {
|
||||
return codeLostEntityMapper.insert(ioCodeLostEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByCode(String code) {
|
||||
return codeLostEntityMapper.delete(new QueryWrapper<IoCodeLostEntity>().eq("code", code));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(IoCodeLostEntity ioCodeLostEntity) {
|
||||
return codeLostEntityMapper.updateById(ioCodeLostEntity);
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.glxp.api.service.inout.impl;
|
||||
|
||||
import com.glxp.api.service.inout.IoCodeRelService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class IoCodeRelServiceImpl implements IoCodeRelService {
|
||||
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.glxp.api.dao.inout.IoCodeLostMapper">
|
||||
</mapper>
|
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.glxp.api.dao.inout.IoCodeRelMapper">
|
||||
</mapper>
|
Loading…
Reference in New Issue