UDI码缺失修改

master
anthonywj 2 years ago
parent 77b9104e71
commit eb2de105f4

@ -11,6 +11,7 @@ import com.glxp.api.constant.BusinessType;
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.IoCodeLostRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.inout.IoCodeLostResponse;
import com.glxp.api.service.inout.IoCodeLostService;
@ -34,13 +35,13 @@ public class IoCodeLostController extends BaseController {
@AuthRuleAnnotation("")
@PostMapping("warehouse/inout/getCodeLost")
public BaseResponse getCodeLost(@RequestBody @Valid IoCodeLostEntity ioCodeLostEntity, BindingResult bindingResult) {
public BaseResponse getCodeLost(@RequestBody @Valid IoCodeLostRequest ioCodeLostEntity, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<IoCodeLostResponse> list = codeLostService.selectLost(ioCodeLostEntity);
PageInfo<IoCodeLostResponse> pageInfo;
pageInfo= new PageInfo<>(list);
pageInfo = new PageInfo<>(list);
PageSimpleResponse<IoCodeLostResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(list);
@ -62,10 +63,6 @@ public class IoCodeLostController extends BaseController {
}
@AuthRuleAnnotation("")
@PostMapping("warehouse/inout/saveTabCode")
public BaseResponse saveCode(@RequestBody IoCodeTempEntity codeTempEntity) {

@ -2,6 +2,7 @@ package com.glxp.api.dao.inout;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.inout.IoCodeLostEntity;
import com.glxp.api.req.inout.IoCodeLostRequest;
import com.glxp.api.res.inout.IoCodeLostResponse;
import org.apache.ibatis.annotations.Mapper;
@ -9,6 +10,6 @@ import java.util.List;
@Mapper
public interface IoCodeLostMapper extends BaseMapperPlus<IoCodeLostMapper, IoCodeLostEntity, IoCodeLostEntity> {
List<IoCodeLostResponse> selectLost(IoCodeLostEntity ioCodeLostEntity);
List<IoCodeLostResponse> selectLost(IoCodeLostRequest ioCodeLostRequest);
}

@ -15,7 +15,7 @@ import lombok.Data;
*/
@Data
@TableName(value = "io_code_lost")
public class IoCodeLostEntity extends ListPageRequest {
public class IoCodeLostEntity {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ -90,7 +90,6 @@ public class IoCodeLostEntity extends ListPageRequest {
private String endTime;
public static final String COL_ID = "id";
public static final String COL_CODE = "code";

@ -0,0 +1,73 @@
package com.glxp.api.req.inout;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.glxp.api.util.page.ListPageRequest;
import lombok.Data;
import java.util.Date;
@Data
public class IoCodeLostRequest extends ListPageRequest {
private Integer id;
/**
* UDI
*/
private String code;
/**
*
*/
private String batchNo;
/**
*
*/
private String produceDate;
/**
*
*/
private String expireDate;
/**
*
*/
private String serialNo;
/**
*
*/
private String supId;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
*
*/
private String remark;
private String nameCode;
private String cpmctymc;
private String ggxh;
private String startTime;
private String endTime;
}

@ -2,13 +2,14 @@ package com.glxp.api.service.inout;
import com.baomidou.mybatisplus.extension.service.IService;
import com.glxp.api.entity.inout.IoCodeLostEntity;
import com.glxp.api.req.inout.IoCodeLostRequest;
import com.glxp.api.res.inout.IoCodeLostResponse;
import java.util.List;
public interface IoCodeLostService extends IService<IoCodeLostEntity> {
List<IoCodeLostResponse> selectLost(IoCodeLostEntity ioCodeLostEntity);
List<IoCodeLostResponse> selectLost(IoCodeLostRequest ioCodeLostRequest);
IoCodeLostEntity findByCode(String code);

@ -1,8 +1,10 @@
package com.glxp.api.service.inout.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.req.inout.IoCodeLostRequest;
import com.glxp.api.res.inout.IoCodeLostResponse;
import org.springframework.stereotype.Service;
@ -18,28 +20,32 @@ import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class IoCodeLostServiceImpl extends ServiceImpl<IoCodeLostMapper,IoCodeLostEntity> implements IoCodeLostService {
public class IoCodeLostServiceImpl extends ServiceImpl<IoCodeLostMapper, IoCodeLostEntity> implements IoCodeLostService {
@Resource
IoCodeLostMapper codeLostEntityMapper;
@Override
public List<IoCodeLostResponse> selectLost(IoCodeLostEntity ioCodeLostEntity) {
if (ioCodeLostEntity == null) {
public List<IoCodeLostResponse> selectLost(IoCodeLostRequest ioCodeLostRequest) {
if (ioCodeLostRequest == null) {
return Collections.emptyList();
}
if (ioCodeLostEntity.getPage() != null) {
int offset = (ioCodeLostEntity.getPage() - 1) * ioCodeLostEntity.getLimit();
PageHelper.offsetPage(offset, ioCodeLostEntity.getLimit());
if (ioCodeLostRequest.getPage() != null) {
int offset = (ioCodeLostRequest.getPage() - 1) * ioCodeLostRequest.getLimit();
PageHelper.offsetPage(offset, ioCodeLostRequest.getLimit());
}
return codeLostEntityMapper.selectLost(ioCodeLostEntity);
return codeLostEntityMapper.selectLost(ioCodeLostRequest);
}
@Override
public IoCodeLostEntity findByCode(String code) {
return codeLostEntityMapper.selectOne(new QueryWrapper<IoCodeLostEntity>().eq("code", code));
List<IoCodeLostEntity> codeLostEntities = codeLostEntityMapper.selectList(new QueryWrapper<IoCodeLostEntity>().eq("code", code).last("limit 1"));
if (CollUtil.isNotEmpty(codeLostEntities)) {
return codeLostEntities.get(0);
}
return null;
}
@Override

@ -1,29 +1,28 @@
<?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">
<select id="selectLost" parameterType="com.glxp.api.entity.inout.IoCodeLostEntity"
<select id="selectLost" parameterType="com.glxp.api.req.inout.IoCodeLostRequest"
resultType="com.glxp.api.res.inout.IoCodeLostResponse">
select io_code_lost.*,basic_products.cpmctymc ,basic_products.ggxh from io_code_lost
LEFT JOIN basic_products on io_code_lost.nameCode=basic_products.nameCode
select io_code_lost.*, basic_products.cpmctymc, basic_products.ggxh
from io_code_lost
LEFT JOIN basic_products on io_code_lost.nameCode = basic_products.nameCode
<where>
<if test="code != '' and code != null">
and code like concat('%',#{code},'%')
and `code` like concat('%', #{code}, '%')
</if>
<if test="cpmctymc != '' and cpmctymc != null">
and basic_products.cpmctymc like concat('%',#{cpmctymc},'%')
and basic_products.cpmctymc like concat('%', #{cpmctymc}, '%')
</if>
<if test="ggxh != '' and ggxh != null">
and basic_products.ggxh like concat('%',#{ggxh},'%')
and basic_products.ggxh like concat('%', #{ggxh}, '%')
</if>
<if test="batchNo != '' and batchNo != null">
and batchNo like concat('%',#{batchNo},'%')
and batchNo like concat('%', #{batchNo}, '%')
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND date_format(io_code_lost.createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d')
</if>
</where>
</select>
</mapper>

Loading…
Cancel
Save