11/20 药品带票出入库查询优化1.0

dev_unify
wangwei 8 months ago
parent 97f4c24dc1
commit 56e74bade8

@ -1677,7 +1677,6 @@ public class IoCodeTempController extends BaseController {
orderService.insertOrder(orderEntity); orderService.insertOrder(orderEntity);
} }
//todo 不关联查了直接查queue表
if (bussinessTypeEntity.getAction().equals(ConstantType.SPLIT_OUT)) { if (bussinessTypeEntity.getAction().equals(ConstantType.SPLIT_OUT)) {
// 判断货位里面是否有相同产品 // 判断货位里面是否有相同产品
if (orderEntity != null && StrUtil.isNotEmpty(orderEntity.getWorkPlaceQueueCode())) { if (orderEntity != null && StrUtil.isNotEmpty(orderEntity.getWorkPlaceQueueCode())) {

@ -65,6 +65,9 @@ public class FilterOrderDetailResultRequest extends ListPageRequest {
private String confirmEndTime; //发票确认结束日期 private String confirmEndTime; //发票确认结束日期
private String corpName;//供应商名字 private String corpName;//供应商名字
private String prepnSpec;
private Boolean groupBuy; //是否集采产品 private Boolean groupBuy; //是否集采产品

@ -233,6 +233,8 @@ public class IoOrderDetailResultResponse {
//生产企业 //生产企业
private String manufactory; private String manufactory;
private String zczbhhzbapzbh;
public String getFromName() { public String getFromName() {
if (StrUtil.isNotEmpty(fromCorpName)) if (StrUtil.isNotEmpty(fromCorpName))

@ -31,6 +31,9 @@
a1.auditTime, a1.auditTime,
bu.isStack, bu.isStack,
bu.groupBuy, bu.groupBuy,
bp.prepnSpec,
COALESCE(bp.ylqxzcrbarmc,bp.manufactory) as manufactory,
bp.zczbhhzbapzbh,
GROUP_CONCAT(ioi.invoiceEncode ORDER BY ioi.invoiceEncode SEPARATOR ',') AS invoiceCodes, GROUP_CONCAT(ioi.invoiceEncode ORDER BY ioi.invoiceEncode SEPARATOR ',') AS invoiceCodes,
b1.NAME AS fromCorpName, b1.NAME AS fromCorpName,
basic_bussiness_type.name billTypeName basic_bussiness_type.name billTypeName
@ -38,6 +41,7 @@
LEFT JOIN io_order a1 ON a1.billNo = a2.orderIdFk LEFT JOIN io_order a1 ON a1.billNo = a2.orderIdFk
LEFT JOIN basic_corp b1 ON b1.erpId = a1.fromCorp LEFT JOIN basic_corp b1 ON b1.erpId = a1.fromCorp
LEFT JOIN basic_udirel bu ON a2.bindRlFk = bu.id LEFT JOIN basic_udirel bu ON a2.bindRlFk = bu.id
inner JOIN basic_products bp ON bp.uuid = bu.uuid
left join basic_bussiness_type on a1.action = basic_bussiness_type.action left join basic_bussiness_type on a1.action = basic_bussiness_type.action
LEFT JOIN io_order_invoice ioi ON a1.billNo = ioi.orderIdFk LEFT JOIN io_order_invoice ioi ON a1.billNo = ioi.orderIdFk
left join auth_warehouse aw on aw.code = a1.fromInvCode left join auth_warehouse aw on aw.code = a1.fromInvCode
@ -52,9 +56,9 @@
<if test="productType != null and productType != ''"> <if test="productType != null and productType != ''">
AND a1.productType = #{productType} AND a1.productType = #{productType}
</if> </if>
<if test="keyWords != null and keyWords != ''"> <!-- <if test="keyWords != null and keyWords != ''">-->
AND (aw.name like concat('%', #{keyWords}, '%') or b1.name like concat('%', #{keyWords}, '%')) <!-- AND (aw.name like concat('%', #{keyWords}, '%') or b1.name like concat('%', #{keyWords}, '%'))-->
</if> <!-- </if>-->
<if test="nameCode != null and nameCode != ''"> <if test="nameCode != null and nameCode != ''">
AND a2.nameCode = #{nameCode} AND a2.nameCode = #{nameCode}
</if> </if>
@ -109,12 +113,29 @@
<if test="productName != null and productName != ''"> <if test="productName != null and productName != ''">
AND a2.coName like concat('%', #{productName}, '%') AND a2.coName like concat('%', #{productName}, '%')
</if> </if>
<if test="prepnSpec != null and prepnSpec != ''">
AND bp.prepnSpec like concat('%', #{prepnSpec}, '%')
</if>
<if test="actions != null and actions.size() != 0"> <if test="actions != null and actions.size() != 0">
AND a1.`action` in AND a1.`action` in
<foreach collection="actions" index="index" item="item" open="(" close=")" separator=","> <foreach collection="actions" index="index" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="keyWords != '' and keyWords != null">
AND (
a2.nameCode LIKE concat('%', #{keyWords}, '%')
or a2.coName like concat('%', #{keyWords}, '%')
or a2.orderIdFk LIKE concat('%', #{keyWords}, '%')
or a2.spec LIKE concat('%', #{keyWords}, '%')
or bp.prepnSpec LIKE concat('%', #{keyWords}, '%')
or a2.batchNo like concat('%', #{keyWords}, '%')
or bp.zczbhhzbapzbh LIKE concat('%', #{keyWords}, '%')
or bp.manufactory LIKE concat('%', #{keyWords}, '%')
or bp.ylqxzcrbarywmc LIKE concat('%', #{keyWords}, '%')
or b1.name like concat('%', #{keyWords}, '%'))
or aw.name like concat('%', #{keyWords}, '%')
</if>
</where> </where>
group by a2.id group by a2.id
</select> </select>

Loading…
Cancel
Save