This commit is contained in:
linfso 2024-07-29 07:31:47 +08:00
parent 28a9eec86a
commit 9bbc2a8e30
4 changed files with 57 additions and 5 deletions

View File

@ -11,10 +11,14 @@
package com.xdadan.erp.web.emis;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.map.MapUtil;
import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter;
import com.xdadan.erp.emis.utils.WaybillHelper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
@ -31,7 +35,6 @@ import com.xdadan.erp.common.core.controller.BaseController;
import com.xdadan.erp.common.core.domain.AjaxResult;
import com.xdadan.erp.common.core.page.TableDataInfo;
import com.xdadan.erp.common.enums.BusinessType;
import com.xdadan.erp.common.utils.StringUtils;
import com.xdadan.erp.common.utils.poi.ExcelUtil;
import com.xdadan.erp.emis.domain.EmisWarehouseIn;
@ -58,6 +61,24 @@ public class EmisWarehouseInController extends EmisBaseController
public TableDataInfo list(EmisWarehouseIn emisWarehouseIn)
{
startPage();
if(!StringUtils.isEmpty(emisWarehouseIn.getBillCode())){
emisWarehouseIn.setBillCode( WaybillHelper.formatQueryValue(emisWarehouseIn.getBillCode()));
String[] billCodeSortList = emisWarehouseIn.getBillCode().split(",");
if(billCodeSortList.length>1){
emisWarehouseIn.getParams().put("billCodeSortList", Arrays.asList(billCodeSortList));
}
}
if(!StringUtils.isEmpty(emisWarehouseIn.getInNo())){
emisWarehouseIn.setInNo(WaybillHelper.formatQueryValue(emisWarehouseIn.getInNo()));
String[] inNoSortList = emisWarehouseIn.getInNo().split(",");
if(inNoSortList.length>1){
emisWarehouseIn.getParams().put("inNoSortList",Arrays.asList(inNoSortList));
}
}
List<EmisWarehouseIn> list = emisWarehouseInService.selectEmisWarehouseInList(emisWarehouseIn);
return getDataTable(list);
}

View File

@ -19,6 +19,8 @@ import com.xdadan.erp.common.core.domain.TreeEntity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import lombok.Data;
@ -60,4 +62,9 @@ public class EmisWarehouseIn extends BaseEntity
/* 状态 0-初始 */
private String status;
// 扩展参数
private EmisWaybill waybillDetail;
// 入仓批次信息
private List<EmisWarehouseInBatch> stockInBatchList;
}

View File

@ -60,7 +60,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
order by create_time desc
</select>
<select id="selectStockInBatchListByInNo" parameterType="Long" resultMap="EmisWarehouseInBatchResult">
select id, serial_no, in_no, in_batch_no, customer_code, customer_name, order_sn, bill_code, trans_car_no, entry_date, confirm_status, confirm_date, status, total_parcel_qty, total_volume, total_weight, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_warehouse_in_batch a
where a.in_no = #{inNo}
</select>
<select id="selectEmisWarehouseInBatchById" parameterType="Long" resultMap="EmisWarehouseInBatchResult">
select id, serial_no, in_no, in_batch_no, customer_code, customer_name, order_sn, bill_code, trans_car_no, entry_date, confirm_status, confirm_date, status, total_parcel_qty, total_volume, total_weight, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_warehouse_in_batch a

View File

@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xdadan.erp.emis.mapper.EmisWarehouseInMapper">
<resultMap type="EmisWarehouseIn" id="EmisWarehouseInResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
<resultMap type="EmisWarehouseIn" id="BaseEmisWarehouseInResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
<result property="id" column="id" />
<result property="serialNo" column="serial_no" />
<result property="inNo" column="in_no" />
@ -20,6 +20,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<resultMap id="EmisWarehouseInResult" type="EmisWarehouseIn" extends="BaseEmisWarehouseInResult" >
<association property="waybillDetail"
column="bill_code"
select="com.xdadan.erp.emis.mapper.EmisWaybillMapper.selectWaybillBaseInfoByBillCode"
fetchType="lazy"
/>
<association property="stockInBatchList"
column="in_no"
select="com.xdadan.erp.emis.mapper.EmisWarehouseInBatchMapper.selectStockInBatchListByInNo"
fetchType="lazy"
/>
</resultMap>
<sql id="selectEmisWarehouseInVo">
select id, serial_no, in_no, order_sn, bill_code, customer_code, customer_name, entry_date, confirm_status, confirm_date, used_status, status, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_warehouse_in
</sql>
@ -30,9 +45,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
del_flag='0'
<if test="id != null "> and id = #{id}</if>
<if test="serialNo != null and serialNo != ''"> and serial_no like concat('%', #{serialNo}, '%')</if>
<if test="inNo != null and inNo != ''"> and in_no like concat('%', #{inNo}, '%')</if>
<if test="inNo != null and inNo != ''">
and ( FIND_IN_SET(`in_no`,#{inNo}) or in_no like concat('%', #{inNo}, '%') )
</if>
<if test="orderSn != null and orderSn != ''"> and order_sn like concat('%', #{orderSn}, '%')</if>
<if test="billCode != null and billCode != ''"> and bill_code=#{billCode}</if>
<if test="billCode != null and billCode != ''"> and ( FIND_IN_SET(`bill_code`,#{billCode}) or bill_code like concat('%', #{billCode}, '%') )</if>
<if test="customerCode != null and customerCode != ''"> and customer_code=#{customerCode}</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="entryDate != null "> and entry_date = #{entryDate}</if>