科室上货转销售出库

dev_2.5_ocean
yewj 4 months ago
parent c099bc5265
commit 5463ced953

@ -133,8 +133,6 @@ public class SysWorkplace implements Serializable {
public Integer jobMode; public Integer jobMode;
@TableField(exist = false) @TableField(exist = false)
private String invName; private String invName;

@ -200,7 +200,7 @@ public class FilterOrderRequest extends ListPageRequest {
private String unionRemark; private String unionRemark;
private String remark; private String remark;
// private String keywords; // private String keywords;
private Integer confirmStatus; private Integer confirmStatus;
private Boolean filterSelected; private Boolean filterSelected;
private List<String> inOrders; private List<String> inOrders;
@ -235,11 +235,15 @@ public class FilterOrderRequest extends ListPageRequest {
private String keyWords; private String keyWords;
/**
*
*/
private List<Long> workplaceCodes;
/** /**
* *
*/ */
private String workPlaceQueueCode; private String workPlaceQueueCode;
} }

@ -262,6 +262,14 @@ public class IoCollectOrderService extends ServiceImpl<IoCollectOrderMapper, IoC
filterOrderRequest.setAction(collectOrderRequest.getBusType()); filterOrderRequest.setAction(collectOrderRequest.getBusType());
filterOrderRequest.setKeyWords(collectOrderRequest.getKeyWords()); filterOrderRequest.setKeyWords(collectOrderRequest.getKeyWords());
if (collectOrderRequest.getBusType().equals(ConstantType.SPLIT_OUT)) {
List<SysWorkplace> sysWorkplaceList = sysWorkplaceService.list(new LambdaQueryWrapper<SysWorkplace>().eq(SysWorkplace::getJobMode, 1));
if (CollUtil.isNotEmpty(sysWorkplaceList)) {
List<Long> workplaceCodes = sysWorkplaceList.stream().map(SysWorkplace::getWorkplaceId).collect(Collectors.toList());
filterOrderRequest.setWorkplaceCodes(workplaceCodes);
filterOrderRequest.setStatus(7);
}
}
List<IoOrderResponse> list = orderService.filterList(filterOrderRequest); List<IoOrderResponse> list = orderService.filterList(filterOrderRequest);
if (list == null) { if (list == null) {
@ -338,6 +346,7 @@ public class IoCollectOrderService extends ServiceImpl<IoCollectOrderMapper, IoC
return ResultVOUtils.success("下载成功"); return ResultVOUtils.success("下载成功");
} }
@Resource @Resource
HeartService heartService; HeartService heartService;
@Resource @Resource

@ -41,6 +41,7 @@ public class AsyncIoCollectOrderDownloadTask implements SchedulingConfigurer {
IoCollectOriginService collectOriginService; IoCollectOriginService collectOriginService;
@Resource @Resource
IoCollectSetService collectSetService; IoCollectSetService collectSetService;
@Override @Override
public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) { public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
scheduledTaskRegistrar.addTriggerTask(() -> process(), scheduledTaskRegistrar.addTriggerTask(() -> process(),
@ -57,39 +58,39 @@ public class AsyncIoCollectOrderDownloadTask implements SchedulingConfigurer {
} }
private void process() { private void process() {
//获取下载的起始时间 //获取下载的起始时间
IoCollectSet ioCollectSet = collectSetService.getSet(); IoCollectSet ioCollectSet = collectSetService.getSet();
Date startDownloadTime = ioCollectSet.getStartDownloadTime(); Date startDownloadTime = ioCollectSet.getStartDownloadTime();
String startDownloadTimes = MsDateUtil.formatDateTime(startDownloadTime); String startDownloadTimes = MsDateUtil.formatDateTime(startDownloadTime);
Boolean autoDownload = ioCollectSet.getAutoDownload(); Boolean autoDownload = ioCollectSet.getAutoDownload();
if (StrUtil.isNotBlank(startDownloadTimes) && autoDownload){ if (StrUtil.isNotBlank(startDownloadTimes) && autoDownload) {
//获取当前时间 //获取当前时间
String paramValue = startDownloadTimes; String paramValue = startDownloadTimes;
String nowTime = MsDateUtil.getDateTime(); String nowTime = MsDateUtil.getDateTime();
CollectOrderRequest collectOrderRequest = new CollectOrderRequest(); CollectOrderRequest collectOrderRequest = new CollectOrderRequest();
collectOrderRequest.setStartTime(paramValue); collectOrderRequest.setStartTime(paramValue);
collectOrderRequest.setEndTime(nowTime); collectOrderRequest.setEndTime(nowTime);
WorkBindBusTypeRequest workBindBusTypeRequest = new WorkBindBusTypeRequest(); WorkBindBusTypeRequest workBindBusTypeRequest = new WorkBindBusTypeRequest();
List<SysWorkplaceDocumentResponse> sysWorkplaceDocumentResponses = sysWorkplaceDocumentDao.filterList(workBindBusTypeRequest); List<SysWorkplaceDocumentResponse> sysWorkplaceDocumentResponses = sysWorkplaceDocumentDao.filterList(workBindBusTypeRequest);
if (CollUtil.isNotEmpty(sysWorkplaceDocumentResponses)) { if (CollUtil.isNotEmpty(sysWorkplaceDocumentResponses)) {
for (SysWorkplaceDocumentResponse sysWorkplaceDocumentResponse : sysWorkplaceDocumentResponses) { for (SysWorkplaceDocumentResponse sysWorkplaceDocumentResponse : sysWorkplaceDocumentResponses) {
String documentTypeCode = sysWorkplaceDocumentResponse.getDocumentTypeCode(); String documentTypeCode = sysWorkplaceDocumentResponse.getDocumentTypeCode();
collectOrderRequest.setBusType(documentTypeCode); collectOrderRequest.setBusType(documentTypeCode);
try{ try {
collectOriginService.downloadOrderV2(collectOrderRequest); collectOriginService.downloadOrderV2(collectOrderRequest);
}catch (Exception e){ } catch (Exception e) {
log.error("自动下载原始单据出错:{}", e.getMessage()); log.error("自动下载原始单据出错:{}", e.getMessage());
}
} }
} }
ioCollectSet.setStartDownloadTime(MsDateUtil.parseDate(nowTime));
collectSetService.updateById(ioCollectSet);
} }
} ioCollectSet.setStartDownloadTime(MsDateUtil.parseDate(nowTime));
collectSetService.updateById(ioCollectSet);
}
}
} }

@ -3,48 +3,48 @@
<mapper namespace="com.glxp.api.dao.inout.IoOrderDao"> <mapper namespace="com.glxp.api.dao.inout.IoOrderDao">
<select id="filterList" resultType="com.glxp.api.res.inout.IoOrderResponse"> <select id="filterList" resultType="com.glxp.api.res.inout.IoOrderResponse">
SELECT io.*, SELECT io.*,
bus.name AS billTypeName, bus.name AS billTypeName,
ad.name AS deptName, ad.name AS deptName,
aw.name AS invName, aw.name AS invName,
au.employeeName AS createUserName, au.employeeName AS createUserName,
au2.employeeName AS updateUserName, au2.employeeName AS updateUserName,
au3.employeeName AS reviewUserName, au3.employeeName AS reviewUserName,
au4.employeeName AS checkUserName, au4.employeeName AS checkUserName,
ad2.name AS fromDeptName, ad2.name AS fromDeptName,
aw2.name AS fromInvName, aw2.name AS fromInvName,
bc1.name AS fromCorpName, bc1.name AS fromCorpName,
bc2.name AS customerName, bc2.name AS customerName,
sw.workplaceName AS workPlaceName, sw.workplaceName AS workPlaceName,
swd.busName AS splitBusTypeName swd.busName AS splitBusTypeName
FROM FROM
io_order io io_order io
LEFT JOIN LEFT JOIN
basic_bussiness_type bus ON bus.action = io.action basic_bussiness_type bus ON bus.action = io.action
LEFT JOIN LEFT JOIN
auth_dept ad ON ad.code = io.deptCode auth_dept ad ON ad.code = io.deptCode
LEFT JOIN LEFT JOIN
auth_warehouse aw ON aw.code = io.invCode auth_warehouse aw ON aw.code = io.invCode
LEFT JOIN LEFT JOIN
auth_user au ON au.id = io.createUser auth_user au ON au.id = io.createUser
LEFT JOIN LEFT JOIN
auth_user au2 ON au2.id = io.updateUser auth_user au2 ON au2.id = io.updateUser
LEFT JOIN LEFT JOIN
auth_user au3 ON au3.id = io.reviewUser auth_user au3 ON au3.id = io.reviewUser
LEFT JOIN LEFT JOIN
auth_user au4 ON au4.id = io.checkUser auth_user au4 ON au4.id = io.checkUser
LEFT JOIN LEFT JOIN
auth_dept ad2 ON ad2.code = io.fromDeptCode auth_dept ad2 ON ad2.code = io.fromDeptCode
LEFT JOIN LEFT JOIN
auth_warehouse aw2 ON aw2.code = io.fromInvCode auth_warehouse aw2 ON aw2.code = io.fromInvCode
LEFT JOIN LEFT JOIN
basic_corp bc1 ON bc1.erpId = io.fromCorp basic_corp bc1 ON bc1.erpId = io.fromCorp
LEFT JOIN LEFT JOIN
basic_corp bc2 ON bc2.erpId = io.customerId basic_corp bc2 ON bc2.erpId = io.customerId
LEFT JOIN LEFT JOIN
io_order_invoice ioi ON ioi.orderIdFk = io.billNo io_order_invoice ioi ON ioi.orderIdFk = io.billNo
LEFT JOIN LEFT JOIN
sys_workplace sw ON sw.workplaceId = io.workPlaceCode sys_workplace sw ON sw.workplaceId = io.workPlaceCode
LEFT JOIN LEFT JOIN
sys_workplace_document swd ON swd.documentTypeCode = io.splitBusType sys_workplace_document swd ON swd.documentTypeCode = io.splitBusType
<if test="uploadKey != null and uploadKey != ''"> <if test="uploadKey != null and uploadKey != ''">
@ -71,7 +71,7 @@
</if> </if>
<if test="corpName != null and corpName != ''"> <if test="corpName != null and corpName != ''">
AND (SELECT NAME FROM auth_warehouse aw2 WHERE aw2.CODE = io.fromInvCode) like AND (SELECT NAME FROM auth_warehouse aw2 WHERE aw2.CODE = io.fromInvCode) like
concat('%', #{corpName}, '%') concat('%', #{corpName}, '%')
</if> </if>
<if test="remark != null and remark != ''"> <if test="remark != null and remark != ''">
AND io.remark like concat('%', #{remark}, '%') AND io.remark like concat('%', #{remark}, '%')
@ -96,9 +96,9 @@
</if> </if>
<if test="keyWord != null and keyWord != ''"> <if test="keyWord != null and keyWord != ''">
AND ( AND (
bc.name like concat('%', #{keyWord}, '%') bc.name like concat('%', #{keyWord}, '%')
or io.remark like concat('%', #{keyWord}, '%') or io.remark like concat('%', #{keyWord}, '%')
or io.fromInvCode like concat('%', #{keyWord}, '%')) or io.fromInvCode like concat('%', #{keyWord}, '%'))
</if> </if>
<if test="deptCode != null and deptCode != ''"> <if test="deptCode != null and deptCode != ''">
AND io.deptCode = #{deptCode} AND io.deptCode = #{deptCode}
@ -120,12 +120,10 @@
AND io.preInSelected is not null AND io.preInSelected is not null
</if> </if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND date_format(io.createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and AND io.createTime between #{startTime} and #{endTime}
date_format(#{endTime}, '%Y-%m-%d')
</if> </if>
<if test="startAduditTime != null and startAduditTime != '' and endAduditTime != null and endAduditTime != ''"> <if test="startAduditTime != null and startAduditTime != '' and endAduditTime != null and endAduditTime != ''">
AND date_format(io.auditTime, '%Y-%m-%d') between date_format(#{startAduditTime}, '%Y-%m-%d') and AND io.auditTime between #{startAduditTime} and #{endAduditTime}
date_format(#{endAduditTime}, '%Y-%m-%d')
</if> </if>
<if test="actions != null and actions.size() != 0"> <if test="actions != null and actions.size() != 0">
AND io.`action` in AND io.`action` in
@ -134,6 +132,13 @@
</foreach> </foreach>
</if> </if>
<if test="workplaceCodes != null and workplaceCodes.size() != 0">
AND io.`workPlaceCode` in
<foreach collection="workplaceCodes" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="sourceTypes != null and sourceTypes.size() != 0"> <if test="sourceTypes != null and sourceTypes.size() != 0">
AND io.fromType in AND io.fromType in
<foreach collection="sourceTypes" index="index" item="item" open="(" close=")" separator=","> <foreach collection="sourceTypes" index="index" item="item" open="(" close=")" separator=",">
@ -142,7 +147,7 @@
</if> </if>
<if test="unionRemark != null and unionRemark != ''"> <if test="unionRemark != null and unionRemark != ''">
AND (io.remark like concat('%', #{unionRemark}, '%') AND (io.remark like concat('%', #{unionRemark}, '%')
or io.outSickInfo like concat('%', #{unionRemark}, '%')) or io.outSickInfo like concat('%', #{unionRemark}, '%'))
</if> </if>
<if test="statuses != null and statuses.size() != 0"> <if test="statuses != null and statuses.size() != 0">
AND io.status in AND io.status in
@ -198,12 +203,12 @@
</if> </if>
<if test="keyWords != null and keyWords != ''"> <if test="keyWords != null and keyWords != ''">
and (io.billNo like concat('%', #{keyWords}, '%') and (io.billNo like concat('%', #{keyWords}, '%')
or bc1.name like concat('%', #{keyWords}, '%') or bc1.name like concat('%', #{keyWords}, '%')
or io.workPlaceCode like concat('%', #{keyWords}, '%') or io.workPlaceCode like concat('%', #{keyWords}, '%')
or io.busType like concat('%', #{keyWords}, '%') or io.busType like concat('%', #{keyWords}, '%')
or sw.workplaceName like concat('%', #{keyWords}, '%') or sw.workplaceName like concat('%', #{keyWords}, '%')
or swd.busName like concat('%', #{keyWords}, '%') or swd.busName like concat('%', #{keyWords}, '%')
or io.fromType like concat('%', #{keyWords}, '%')) or io.fromType like concat('%', #{keyWords}, '%'))
</if> </if>
<if test="supInoivceSearch != null"> <if test="supInoivceSearch != null">
@ -222,7 +227,7 @@
#{item} #{item}
</foreach> </foreach>
and io.status = 7 and io.status = 7
) )
</if> </if>
<if test="invoiceActions1 != null and invoiceActions2 != null"> <if test="invoiceActions1 != null and invoiceActions2 != null">
@ -231,13 +236,13 @@
#{item} #{item}
</foreach> </foreach>
and io.status = 10) and io.status = 10)
or ( or (
`action` in `action` in
<foreach collection="invoiceActions2" index="index" item="item" open="(" close=")" separator=","> <foreach collection="invoiceActions2" index="index" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
and io.status = 7) and io.status = 7)
) )
</if> </if>
</if> </if>
GROUP BY io.billNo GROUP BY io.billNo
@ -257,7 +262,7 @@
from io_order from io_order
<where> <where>
<if test="billNo != null and billNo != ''"> <if test="billNo != null and billNo != ''">
AND billNo like concat( #{billNo}, '%') AND billNo like concat(#{billNo}, '%')
</if> </if>
<if test="action != null and action != ''"> <if test="action != null and action != ''">
AND action = #{action} AND action = #{action}
@ -292,14 +297,14 @@
</if> </if>
<if test="unionRemark != null and unionRemark != ''"> <if test="unionRemark != null and unionRemark != ''">
AND (io_order.remark like concat('%', #{unionRemark}, '%') AND (io_order.remark like concat('%', #{unionRemark}, '%')
or io_order.outSickInfo like concat('%', #{unionRemark}, '%')) or io_order.outSickInfo like concat('%', #{unionRemark}, '%'))
</if> </if>
<if test="busType != null"> <if test="busType != null">
AND busType = #{busType} AND busType = #{busType}
</if> </if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and
date_format(#{endTime}, '%Y-%m-%d') date_format(#{endTime}, '%Y-%m-%d')
</if> </if>
<if test="lastUpdateTime != null and lastUpdateTime != ''"> <if test="lastUpdateTime != null and lastUpdateTime != ''">
<![CDATA[ <![CDATA[
@ -315,13 +320,11 @@
SELECT io.* SELECT io.*
FROM io_order io FROM io_order io
WHERE (io.supplementNo IS NULL OR io.supplementNo = '') WHERE (io.supplementNo IS NULL OR io.supplementNo = '')
AND EXISTS( AND EXISTS(SELECT 1
SELECT 1 FROM basic_bussiness_type bbt
FROM basic_bussiness_type bbt WHERE bbt.action = io.action
WHERE bbt.action = io.action AND bbt.supplementOrderType IS NOT NULL
AND bbt.supplementOrderType IS NOT NULL AND bbt.supplementOrderType != '')
AND bbt.supplementOrderType != ''
)
</select> </select>
<select id="selectBillNos" resultType="com.glxp.api.res.inout.OrderNoResult"> <select id="selectBillNos" resultType="com.glxp.api.res.inout.OrderNoResult">
@ -331,46 +334,44 @@
</select> </select>
<select id="selectUploadOrder" resultType="com.glxp.api.res.inout.IoOrderResponse"> <select id="selectUploadOrder" resultType="com.glxp.api.res.inout.IoOrderResponse">
SELECT SELECT io.*,
io.*, ioul.result,
ioul.result, bbt.name AS billTypeName,
bbt.name AS billTypeName, ad.name AS deptName,
ad.name AS deptName, aw.name AS invName,
aw.name AS invName, au_create.employeeName AS createUserName,
au_create.employeeName AS createUserName, au_update.employeeName AS updateUserName,
au_update.employeeName AS updateUserName, au_review.employeeName AS reviewUserName,
au_review.employeeName AS reviewUserName, au_check.employeeName AS checkUserName,
au_check.employeeName AS checkUserName, ad_from.name AS fromDeptName,
ad_from.name AS fromDeptName, aw_from.name AS fromInvName,
aw_from.name AS fromInvName, bc_from.name AS fromCorpName,
bc_from.name AS fromCorpName, bc_customer.name AS customerName
bc_customer.name AS customerName FROM io_order io
FROM LEFT JOIN
io_order io io_order_upload_log ioul ON io.billNo = ioul.billNo
LEFT JOIN LEFT JOIN
io_order_upload_log ioul ON io.billNo = ioul.billNo basic_bussiness_type bbt ON bbt.action = io.action
LEFT JOIN LEFT JOIN
basic_bussiness_type bbt ON bbt.action = io.action auth_dept ad ON ad.code = io.deptCode
LEFT JOIN LEFT JOIN
auth_dept ad ON ad.code = io.deptCode auth_warehouse aw ON aw.code = io.invCode
LEFT JOIN LEFT JOIN
auth_warehouse aw ON aw.code = io.invCode auth_user au_create ON au_create.id = io.createUser
LEFT JOIN LEFT JOIN
auth_user au_create ON au_create.id = io.createUser auth_user au_update ON au_update.id = io.updateUser
LEFT JOIN LEFT JOIN
auth_user au_update ON au_update.id = io.updateUser auth_user au_review ON au_review.id = io.reviewUser
LEFT JOIN LEFT JOIN
auth_user au_review ON au_review.id = io.reviewUser auth_user au_check ON au_check.id = io.checkUser
LEFT JOIN LEFT JOIN
auth_user au_check ON au_check.id = io.checkUser auth_dept ad_from ON ad_from.code = io.fromDeptCode
LEFT JOIN LEFT JOIN
auth_dept ad_from ON ad_from.code = io.fromDeptCode auth_warehouse aw_from ON aw_from.code = io.fromInvCode
LEFT JOIN LEFT JOIN
auth_warehouse aw_from ON aw_from.code = io.fromInvCode basic_corp bc_from ON bc_from.erpId = io.fromCorp
LEFT JOIN LEFT JOIN
basic_corp bc_from ON bc_from.erpId = io.fromCorp basic_corp bc_customer ON bc_customer.erpId = io.customerId
LEFT JOIN
basic_corp bc_customer ON bc_customer.erpId = io.customerId
<where> <where>
io.dealStatus = 3 io.dealStatus = 3
<if test="billNo != null and billNo != ''"> <if test="billNo != null and billNo != ''">
@ -390,7 +391,7 @@
</if> </if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and
date_format(#{endTime}, '%Y-%m-%d') date_format(#{endTime}, '%Y-%m-%d')
</if> </if>
<if test="startTime != null and startTime != '' and (endTime == null or endTime == '')"> <if test="startTime != null and startTime != '' and (endTime == null or endTime == '')">
AND date_format(createTime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') AND date_format(createTime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d')
@ -417,10 +418,10 @@
<select id="selectWaitSubmitOrder" resultType="java.lang.String"> <select id="selectWaitSubmitOrder" resultType="java.lang.String">
select t.billNo select t.billNo
from io_order t from io_order t
left join thr_system_bus_api t1 on t.action = t1.code left join thr_system_bus_api t1 on t.action = t1.code
<where> <where>
t.status = 7 t.status = 7
and exportStatus = 0 and exportStatus = 0
<if test="thirdSys != null and thirdSys != ''"> <if test="thirdSys != null and thirdSys != ''">
AND t1.thirdSys = #{thirdSys} AND t1.thirdSys = #{thirdSys}
</if> </if>
@ -455,13 +456,13 @@
<select id="selectOrderfirstAndLastIdList" resultType="java.lang.String"> <select id="selectOrderfirstAndLastIdList" resultType="java.lang.String">
SELECT billNo SELECT billNo
FROM io_order FROM io_order
LEFT JOIN basic_bussiness_type ON io_order.action = basic_bussiness_type.action LEFT JOIN basic_bussiness_type ON io_order.action = basic_bussiness_type.action
<where> <where>
basic_bussiness_type.inStock = 1 basic_bussiness_type.inStock = 1
and io_order.`status` = 7 and io_order.`status` = 7
AND date_format(io_order.updateTime, '%Y-%m-%d') between date_format(#{firstData}, '%Y-%m-%d') and AND date_format(io_order.updateTime, '%Y-%m-%d') between date_format(#{firstData}, '%Y-%m-%d') and
date_format(#{lastData}, '%Y-%m-%d') date_format(#{lastData}, '%Y-%m-%d')
<if test="invCode != null and invCode != ''"> <if test="invCode != null and invCode != ''">
AND io_order.invCode = #{invCode} AND io_order.invCode = #{invCode}
@ -473,16 +474,16 @@
<!-- LEFT JOIN io_order_detail_code dc ON io.billNo = dc.orderIdFk--> <!-- LEFT JOIN io_order_detail_code dc ON io.billNo = dc.orderIdFk-->
<select id="getfilterOrderList" resultType="com.glxp.api.res.inout.IoOrderResponse"> <select id="getfilterOrderList" resultType="com.glxp.api.res.inout.IoOrderResponse">
SELECT io.*, SELECT io.*,
bus.NAME AS billTypeName, bus.NAME AS billTypeName,
ad.NAME AS deptName, ad.NAME AS deptName,
aw.NAME AS invName, aw.NAME AS invName,
bc.NAME AS fromCorpName bc.NAME AS fromCorpName
FROM io_order io FROM io_order io
LEFT JOIN basic_bussiness_type bus ON io.action = bus.action LEFT JOIN basic_bussiness_type bus ON io.action = bus.action
LEFT JOIN auth_dept ad ON io.deptCode = ad.CODE LEFT JOIN auth_dept ad ON io.deptCode = ad.CODE
LEFT JOIN auth_warehouse aw ON io.invCode = aw.CODE LEFT JOIN auth_warehouse aw ON io.invCode = aw.CODE
LEFT JOIN basic_corp bc ON io.fromCorp = bc.erpId LEFT JOIN basic_corp bc ON io.fromCorp = bc.erpId
left join io_order_invoice on io_order_invoice.orderIdFk = io.billNo left join io_order_invoice on io_order_invoice.orderIdFk = io.billNo
<where> <where>
<if test="confirmStatus != null and confirmStatus != ''"> <if test="confirmStatus != null and confirmStatus != ''">
AND io.checkStatus = #{confirmStatus} AND io.checkStatus = #{confirmStatus}
@ -492,7 +493,7 @@
</if> </if>
<if test="corpName != null and corpName != ''"> <if test="corpName != null and corpName != ''">
AND (SELECT NAME FROM auth_warehouse aw2 WHERE aw2.CODE = io.fromInvCode) like AND (SELECT NAME FROM auth_warehouse aw2 WHERE aw2.CODE = io.fromInvCode) like
concat('%', #{corpName}, '%') concat('%', #{corpName}, '%')
</if> </if>
<if test="action != null and action != ''"> <if test="action != null and action != ''">
AND io.action = #{action} AND io.action = #{action}
@ -502,10 +503,10 @@
</if> </if>
<if test="unionRemark != null and unionRemark != ''"> <if test="unionRemark != null and unionRemark != ''">
AND (io.remark like concat('%', #{unionRemark}, '%') AND (io.remark like concat('%', #{unionRemark}, '%')
or io.outSickInfo like concat('%', #{unionRemark}, '%')) or io.outSickInfo like concat('%', #{unionRemark}, '%'))
</if> </if>
<if test="billNo != null and billNo != ''"> <if test="billNo != null and billNo != ''">
AND io.billNo like concat( #{billNo}, '%') AND io.billNo like concat(#{billNo}, '%')
</if> </if>
<if test="corpOrderId != null and corpOrderId != ''"> <if test="corpOrderId != null and corpOrderId != ''">
AND io.corpOrderId = #{corpOrderId} AND io.corpOrderId = #{corpOrderId}
@ -540,11 +541,11 @@
</if> </if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND date_format(io.createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and AND date_format(io.createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and
date_format(#{endTime}, '%Y-%m-%d') date_format(#{endTime}, '%Y-%m-%d')
</if> </if>
<if test="startAduditTime != null and startAduditTime != '' and endAduditTime != null and endAduditTime != ''"> <if test="startAduditTime != null and startAduditTime != '' and endAduditTime != null and endAduditTime != ''">
AND date_format(io.auditTime, '%Y-%m-%d') between date_format(#{startAduditTime}, '%Y-%m-%d') and AND date_format(io.auditTime, '%Y-%m-%d') between date_format(#{startAduditTime}, '%Y-%m-%d') and
date_format(#{endAduditTime}, '%Y-%m-%d') date_format(#{endAduditTime}, '%Y-%m-%d')
</if> </if>
<if test="actions != null and actions.size() != 0"> <if test="actions != null and actions.size() != 0">
AND io.`action` in AND io.`action` in
@ -601,7 +602,7 @@
#{item} #{item}
</foreach> </foreach>
and io.status = 7 and io.status = 7
) )
</if> </if>
<if test="invoiceActions1 != null and invoiceActions2 != null"> <if test="invoiceActions1 != null and invoiceActions2 != null">
@ -610,13 +611,13 @@
#{item} #{item}
</foreach> </foreach>
and io.status = 10) and io.status = 10)
or ( or (
io.`action` in io.`action` in
<foreach collection="invoiceActions2" index="index" item="item" open="(" close=")" separator=","> <foreach collection="invoiceActions2" index="index" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
and io.status = 7) and io.status = 7)
) )
</if> </if>
</if> </if>
</where> </where>

Loading…
Cancel
Save