1.添加单据,码表相关的查询接口
parent
7c2a255464
commit
24a1236685
@ -1,14 +1,54 @@
|
||||
package com.glxp.api.controller.inout;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.controller.BaseController;
|
||||
import com.glxp.api.req.inout.FilterIoCodeRequest;
|
||||
import com.glxp.api.res.inout.IoCodeResponse;
|
||||
import com.glxp.api.service.inout.IoCodeService;
|
||||
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 IoCodeController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private IoCodeService ioCodeService;
|
||||
|
||||
/**
|
||||
* 查询单据正式码表数据
|
||||
*
|
||||
* @param filterIoCodeRequest
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/udiwms/inout/code/filterList")
|
||||
public BaseResponse filterList(FilterIoCodeRequest filterIoCodeRequest) {
|
||||
List<IoCodeResponse> list = ioCodeService.filterList(filterIoCodeRequest);
|
||||
PageInfo<IoCodeResponse> pageInfo = new PageInfo<>(list);
|
||||
return ResultVOUtils.page(pageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据单据号查询正式码表数据
|
||||
*
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/udiwms/inout/code/findByOrderId")
|
||||
public BaseResponse findAllByOrderId(String orderId) {
|
||||
FilterIoCodeRequest filterIoCodeRequest = new FilterIoCodeRequest();
|
||||
filterIoCodeRequest.setOrderId(orderId);
|
||||
List<IoCodeResponse> list = ioCodeService.filterList(filterIoCodeRequest);
|
||||
PageInfo<IoCodeResponse> pageInfo = new PageInfo<>(list);
|
||||
return ResultVOUtils.success(pageInfo);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,10 @@
|
||||
package com.glxp.api.req.inout;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class FilterOrderDetailRequest {
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.glxp.api.res.inout;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 单据业务详情VO
|
||||
*/
|
||||
@Data
|
||||
public class IoOrderDetailBizResponse {
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.glxp.api.res.inout;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 单据详情VO
|
||||
*/
|
||||
@Data
|
||||
public class IoOrderDetailResponse {
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.glxp.api.res.inout;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 单据扫码明细VO
|
||||
*/
|
||||
@Data
|
||||
public class IoOrderDetailResultResponse {
|
||||
|
||||
}
|
@ -1,22 +1,44 @@
|
||||
package com.glxp.api.service.inout;
|
||||
|
||||
import com.glxp.api.entity.inout.IoCodeEnttity;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.entity.inout.IoCodeEntity;
|
||||
import com.glxp.api.req.inout.FilterIoCodeRequest;
|
||||
import com.glxp.api.res.inout.IoCodeResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IoCodeService {
|
||||
|
||||
int insert(IoCodeEnttity codeEnttity);
|
||||
int insert(IoCodeEntity codeEnttity);
|
||||
|
||||
boolean insertBatch(List<IoCodeEnttity> codeEnttities);
|
||||
boolean insertBatch(List<IoCodeEntity> codeEnttities);
|
||||
|
||||
List<IoCodeEnttity> findByOrderId(String billNo);
|
||||
List<IoCodeEntity> findByOrderId(String billNo);
|
||||
|
||||
int updateById(IoCodeEnttity codeEnttity);
|
||||
int updateById(IoCodeEntity codeEnttity);
|
||||
|
||||
public IoCodeEnttity findByUnique(String orderId, String code);
|
||||
public IoCodeEntity findByUnique(String orderId, String code);
|
||||
|
||||
/**
|
||||
* 查询正式码表实体数据
|
||||
*
|
||||
* @param filterIoCodeRequest
|
||||
* @return
|
||||
*/
|
||||
List<IoCodeEntity> filterCodeList(FilterIoCodeRequest filterIoCodeRequest);
|
||||
|
||||
/**
|
||||
* 查询正式码表VO数据
|
||||
*/
|
||||
List<IoCodeResponse> filterList(FilterIoCodeRequest filterIoCodeRequest);
|
||||
|
||||
/**
|
||||
* 根据单号删除正式码表数据
|
||||
*
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
BaseResponse deleteCodeByOrderId(String orderId);
|
||||
|
||||
List<IoCodeEnttity> filterCodeList(FilterIoCodeRequest filterIoCodeRequest);
|
||||
|
||||
}
|
||||
|
@ -1,8 +1,107 @@
|
||||
<?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.IoCodeDao">
|
||||
<select id="filterCodeList" resultType="com.glxp.api.entity.inout.IoCodeEntity"
|
||||
parameterType="com.glxp.api.req.inout.FilterIoCodeRequest">
|
||||
select *
|
||||
from io_code
|
||||
<where>
|
||||
<if test="code != null and code != ''">
|
||||
AND code = #{code}
|
||||
</if>
|
||||
<if test="orderId != null and orderId != ''">
|
||||
AND orderId like concat('%', #{orderId}, '%')
|
||||
</if>
|
||||
<if test="nameCode != null and nameCode != ''">
|
||||
AND nameCode like concat('%', #{nameCode}, '%')
|
||||
</if>
|
||||
<if test="supId != null and supId != ''">
|
||||
AND supId like concat('%', #{supId}, '%')
|
||||
</if>
|
||||
<if test="relId != null and relId != ''">
|
||||
AND relId like concat('%', #{relId}, '%')
|
||||
</if>
|
||||
<if test="deptCode != null and deptCode != ''">
|
||||
AND deptCode = #{deptCode}
|
||||
</if>
|
||||
<if test="invCode != null and invCode != ''">
|
||||
AND invCode = #{invCode}
|
||||
</if>
|
||||
<if test="warehouseCode != null and warehouseCode != ''">
|
||||
AND warehouseCode = #{warehouseCode}
|
||||
</if>
|
||||
<if test="packageLevel != null and packageLevel != ''">
|
||||
AND packageLevel = #{packageLevel}
|
||||
</if>
|
||||
<if test="batchNo != null and batchNo != ''">
|
||||
AND batchNo = #{batchNo}
|
||||
</if>
|
||||
<if test="corpOrderId != null and corpOrderId != ''">
|
||||
AND corpOrderId = #{corpOrderId}
|
||||
</if>
|
||||
<if test="actions != null and actions.size() != 0">
|
||||
AND action in
|
||||
<foreach collection="actions" item="item" open="(" close=")" index="index" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="filterCodeList" resultType="com.glxp.api.entity.inout.IoCodeEnttity">
|
||||
|
||||
<select id="filterList" resultType="com.glxp.api.res.inout.IoCodeResponse">
|
||||
select ic.*,
|
||||
bp.cpmctymc productName,
|
||||
ad.name deptName,
|
||||
aw.name invName,
|
||||
auth_space.name warehouseName,
|
||||
bc.name supName
|
||||
from io_code ic
|
||||
left join auth_dept ad on ic.deptCode = ad.code
|
||||
left join auth_warehouse aw on ic.invCode = aw.code
|
||||
left join auth_space on auth_space.code = ic.warehouseCode
|
||||
left join basic_udirel bu on bu.id = ic.relId
|
||||
left join basic_products bp on bu.uuid = bp.uuid
|
||||
left join basic_corp bc on bc.erpId = ic.supId
|
||||
<where>
|
||||
<if test="code != null and code != ''">
|
||||
AND code = #{code}
|
||||
</if>
|
||||
<if test="orderId != null and orderId != ''">
|
||||
AND orderId like concat('%', #{orderId}, '%')
|
||||
</if>
|
||||
<if test="nameCode != null and nameCode != ''">
|
||||
AND nameCode like concat('%', #{nameCode}, '%')
|
||||
</if>
|
||||
<if test="supId != null and supId != ''">
|
||||
AND supId like concat('%', #{supId}, '%')
|
||||
</if>
|
||||
<if test="relId != null and relId != ''">
|
||||
AND relId like concat('%', #{relId}, '%')
|
||||
</if>
|
||||
<if test="deptCode != null and deptCode != ''">
|
||||
AND deptCode = #{deptCode}
|
||||
</if>
|
||||
<if test="invCode != null and invCode != ''">
|
||||
AND invCode = #{invCode}
|
||||
</if>
|
||||
<if test="warehouseCode != null and warehouseCode != ''">
|
||||
AND warehouseCode = #{warehouseCode}
|
||||
</if>
|
||||
<if test="packageLevel != null and packageLevel != ''">
|
||||
AND packageLevel = #{packageLevel}
|
||||
</if>
|
||||
<if test="batchNo != null and batchNo != ''">
|
||||
AND batchNo = #{batchNo}
|
||||
</if>
|
||||
<if test="corpOrderId != null and corpOrderId != ''">
|
||||
AND corpOrderId = #{corpOrderId}
|
||||
</if>
|
||||
<if test="actions != null and actions.size() != 0">
|
||||
AND action in
|
||||
<foreach collection="actions" item="item" open="(" close=")" index="index" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
@ -1,4 +1,88 @@
|
||||
<?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.IoOrderDao">
|
||||
<select id="filterList" resultType="com.glxp.api.res.inout.IoOrderResponse">
|
||||
select io_order.*,
|
||||
bu.name billTypeName,
|
||||
auth_user.employeeName createUserName,
|
||||
auth_dept.name deptName,
|
||||
auth_warehouse.name invName
|
||||
from io_order
|
||||
left join basic_bussiness_type bu on io_order.action = bu.action
|
||||
left join auth_user on auth_user.id = io_order.createUser or auth_user.id = io_order.updateUser
|
||||
or auth_user.id = io_order.reviewUser
|
||||
left join auth_dept on auth_dept.code = io_order.deptCode
|
||||
left join auth_warehouse on auth_warehouse.code = io_order.invCode
|
||||
<where>
|
||||
<if test="id != null and id != ''">
|
||||
AND io_order.id = #{id}
|
||||
</if>
|
||||
<if test="billNo != null and billNo != ''">
|
||||
AND billNo like concat('%', #{billNo}, '%')
|
||||
</if>
|
||||
<if test="corpOrderId != null and corpOrderId != ''">
|
||||
AND corpOrderId = #{corpOrderId}
|
||||
</if>
|
||||
<if test="deptCode != null and deptCode != ''">
|
||||
AND deptCode = #{deptCode}
|
||||
</if>
|
||||
<if test="invCode != null and invCode != ''">
|
||||
AND invCode = #{invCode}
|
||||
</if>
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
AND io_order.createTime between #{startTime} and #{endTime}
|
||||
</if>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND io_order.createTime >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND io_order.createTime <= #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="filterOrderList" resultType="com.glxp.api.entity.inout.IoOrderEntity">
|
||||
select * from io_order
|
||||
<where>
|
||||
<if test="billNo != null and billNo != ''">
|
||||
AND billNo like concat('%', #{billNo}, '%')
|
||||
</if>
|
||||
<if test="id != null and id != ''">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="action != null and action != ''">
|
||||
AND action = #{action}
|
||||
</if>
|
||||
<if test="mainAction != null and mainAction != ''">
|
||||
AND mainAction = #{mainAction}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="corpOrderId != null and corpOrderId != ''">
|
||||
AND corpOrderId = #{corpOrderId}
|
||||
</if>
|
||||
<if test="fromCorp != null and fromCorp != ''">
|
||||
AND fromCorp = #{fromCorp}
|
||||
</if>
|
||||
<if test="customerId != null and customerId != ''">
|
||||
AND customerId = #{customerId}
|
||||
</if>
|
||||
<if test="invCode != null and invCode != ''">
|
||||
AND invCode = #{invCode}
|
||||
</if>
|
||||
<if test="deptCode != null and deptCode != ''">
|
||||
AND deptCode = #{deptCode}
|
||||
</if>
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
AND createTime between #{startTime} and #{endTime}
|
||||
</if>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND createTime >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND createTime <= #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue