多级产品页面代码提交
parent
9d5da74e33
commit
a89aba0977
@ -0,0 +1,40 @@
|
|||||||
|
package com.glxp.api.controller.inout;
|
||||||
|
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
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.req.inout.IoOrderRelRequest;
|
||||||
|
import com.glxp.api.req.purchase.PurApplyRequest;
|
||||||
|
import com.glxp.api.res.PageSimpleResponse;
|
||||||
|
import com.glxp.api.res.inout.IoCodeLostResponse;
|
||||||
|
import com.glxp.api.res.inout.IoCodeRelResponse;
|
||||||
|
import com.glxp.api.res.purchase.PurApplyResponse;
|
||||||
|
import com.glxp.api.service.inout.IoCodeRelService;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class ioCodeRelController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
IoCodeRelService ioCodeRelServicec;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/udi/ioCode/Rel/list")
|
||||||
|
public BaseResponse list(IoOrderRelRequest ioOrderRelRequest) {
|
||||||
|
|
||||||
|
List<IoCodeRelResponse> list = ioCodeRelServicec.selectIoCodeRelList(ioOrderRelRequest);
|
||||||
|
PageInfo<IoCodeRelResponse> pageInfo;
|
||||||
|
pageInfo = new PageInfo<>(list);
|
||||||
|
PageSimpleResponse<IoCodeRelResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
||||||
|
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||||
|
pageSimpleResponse.setList(list);
|
||||||
|
return ResultVOUtils.success(pageSimpleResponse);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +1,17 @@
|
|||||||
package com.glxp.api.dao.inout;
|
package com.glxp.api.dao.inout;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.glxp.api.entity.inout.IoCodeLostEntity;
|
||||||
import com.glxp.api.entity.inout.IoCodeRelEntity;
|
import com.glxp.api.entity.inout.IoCodeRelEntity;
|
||||||
|
import com.glxp.api.req.inout.IoOrderRelRequest;
|
||||||
|
import com.glxp.api.res.inout.IoCodeLostResponse;
|
||||||
|
import com.glxp.api.res.inout.IoCodeRelResponse;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface IoCodeRelMapper extends BaseMapper<IoCodeRelEntity> {
|
public interface IoCodeRelMapper extends BaseMapper<IoCodeRelEntity> {
|
||||||
|
|
||||||
|
List<IoCodeRelResponse> selectIoCodeRelList(IoOrderRelRequest ioOrderRelRequest);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
package com.glxp.api.req.inout;
|
||||||
|
|
||||||
|
import com.glxp.api.util.page.ListPageRequest;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class IoOrderRelRequest extends ListPageRequest {
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
private String cpmctymc;
|
||||||
|
private String nameCode;
|
||||||
|
private String ggxh;
|
||||||
|
private String serialNo;
|
||||||
|
private String startTime;
|
||||||
|
private String endTime;
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.glxp.api.res.inout;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class IoCodeRelResponse {
|
||||||
|
|
||||||
|
|
||||||
|
private Integer id;
|
||||||
|
private String code;
|
||||||
|
private String parentCode;
|
||||||
|
private String nameCode;
|
||||||
|
private Byte diType;
|
||||||
|
private String mainNameCode;
|
||||||
|
private String level;
|
||||||
|
private String produceDate;
|
||||||
|
private String expireDate;
|
||||||
|
private String serialNo;
|
||||||
|
private Date createTime;
|
||||||
|
private Date updateTime;
|
||||||
|
private String cpmctymc;
|
||||||
|
private String ggxh;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,9 +1,31 @@
|
|||||||
package com.glxp.api.service.inout.impl;
|
package com.glxp.api.service.inout.impl;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.glxp.api.dao.inout.IoCodeRelMapper;
|
||||||
|
import com.glxp.api.req.inout.IoOrderRelRequest;
|
||||||
|
import com.glxp.api.res.inout.IoCodeRelResponse;
|
||||||
import com.glxp.api.service.inout.IoCodeRelService;
|
import com.glxp.api.service.inout.IoCodeRelService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class IoCodeRelServiceImpl implements IoCodeRelService {
|
public class IoCodeRelServiceImpl implements IoCodeRelService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
IoCodeRelMapper ioCodeRelMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<IoCodeRelResponse> selectIoCodeRelList(IoOrderRelRequest ioOrderRelRequest) {
|
||||||
|
if (ioOrderRelRequest == null) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
if (ioOrderRelRequest.getPage() != null) {
|
||||||
|
int offset = (ioOrderRelRequest.getPage() - 1) * ioOrderRelRequest.getLimit();
|
||||||
|
PageHelper.offsetPage(offset, ioOrderRelRequest.getLimit());
|
||||||
|
}
|
||||||
|
return ioCodeRelMapper.selectIoCodeRelList(ioOrderRelRequest);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,33 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!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 namespace="com.glxp.api.dao.inout.IoCodeRelMapper">
|
||||||
|
|
||||||
|
<select id="selectIoCodeRelList" parameterType="com.glxp.api.req.inout.IoOrderRelRequest"
|
||||||
|
resultType="com.glxp.api.res.inout.IoCodeRelResponse">
|
||||||
|
select io_code_rel.*, basic_products.cpmctymc, basic_products.ggxh
|
||||||
|
from io_code_rel
|
||||||
|
LEFT JOIN basic_products on io_code_rel.nameCode = basic_products.nameCode
|
||||||
|
<where>
|
||||||
|
<if test="code != '' and code != null">
|
||||||
|
and io_code_rel.code like concat('%', #{code}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="nameCode != '' and nameCode != null">
|
||||||
|
and io_code_rel.nameCode=#{nameCode}
|
||||||
|
</if>
|
||||||
|
<if test="cpmctymc != '' and cpmctymc != null">
|
||||||
|
and basic_products.cpmctymc like concat('%', #{cpmctymc}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="ggxh != '' and ggxh != null">
|
||||||
|
and basic_products.ggxh like concat('%', #{ggxh}, '%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="serialNo != '' and serialNo != null">
|
||||||
|
and io_code_rel.serialNo like concat('%', #{serialNo}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||||
|
AND date_format(io_code_rel.createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue