收发货统计表还原未按商品分组版本

This commit is contained in:
liujie 2024-07-30 11:11:11 +08:00
parent 0fe65b9d2a
commit c936c29528
7 changed files with 3 additions and 139 deletions

View File

@ -63,7 +63,6 @@ public class RecordsExcel {
@ApiParam(required = false, value = "业务员名称") @RequestParam(required = false) String staffName, @ApiParam(required = false, value = "业务员名称") @RequestParam(required = false) String staffName,
@ApiParam(required = false, value = "营销区域id(逗号分隔)") @RequestParam(required = false) String areaIds, @ApiParam(required = false, value = "营销区域id(逗号分隔)") @RequestParam(required = false) String areaIds,
@ApiParam(required = false, value = "业务员id(逗号分隔)") @RequestParam(required = false) String staffIds, @ApiParam(required = false, value = "业务员id(逗号分隔)") @RequestParam(required = false) String staffIds,
@ApiParam(required = false, value = "商品編碼") @RequestParam(required = false) String goodsNo,
@ApiParam(required = false, value = "开始时间") @RequestParam(required = false) String startTime, @ApiParam(required = false, value = "开始时间") @RequestParam(required = false) String startTime,
@ApiParam(required = false, value = "结束时间") @RequestParam(required = false) String endTime, @ApiParam(required = false, value = "结束时间") @RequestParam(required = false) String endTime,
HttpServletResponse response) throws Exception { HttpServletResponse response) throws Exception {
@ -81,7 +80,6 @@ public class RecordsExcel {
params.put("staffName", staffName); params.put("staffName", staffName);
params.put("startTime", startTime); params.put("startTime", startTime);
params.put("endTime", endTime); params.put("endTime", endTime);
params.put("goodsNo", goodsNo);
if (StringUtil.isNotEmpty(areaIds)) { if (StringUtil.isNotEmpty(areaIds)) {
params.put("areaIds", areaIds.split(",", -1)); params.put("areaIds", areaIds.split(",", -1));
} }
@ -100,12 +98,6 @@ public class RecordsExcel {
receiptRecordsBo.setClientId(String.valueOf(objectMap.get("clientId"))); receiptRecordsBo.setClientId(String.valueOf(objectMap.get("clientId")));
// 客户U8编码 // 客户U8编码
receiptRecordsBo.setUecode(String.valueOf(objectMap.get("uecode"))); receiptRecordsBo.setUecode(String.valueOf(objectMap.get("uecode")));
// 商品编码
receiptRecordsBo.setGoodsNo(String.valueOf(objectMap.get("goodsNo")));
// 商品名称
receiptRecordsBo.setGoodsName(String.valueOf(objectMap.get("goodsName")));
// 规格
receiptRecordsBo.setSpecification(String.valueOf(objectMap.get("specification")));
// 营销区域ID // 营销区域ID
receiptRecordsBo.setAreaId(String.valueOf(objectMap.get("areaId"))); receiptRecordsBo.setAreaId(String.valueOf(objectMap.get("areaId")));
// 营销区域名称 // 营销区域名称

View File

@ -567,7 +567,6 @@ public class ReceiptRecordsApi extends BaseController {
@ApiParam(required = false, value = "营销区域id") @RequestParam(required = false) String areaId, @ApiParam(required = false, value = "营销区域id") @RequestParam(required = false) String areaId,
@ApiParam(required = false, value = "开始时间") @RequestParam(required = false) String startTime, @ApiParam(required = false, value = "开始时间") @RequestParam(required = false) String startTime,
@ApiParam(required = false, value = "结束时间") @RequestParam(required = false) String endTime, @ApiParam(required = false, value = "结束时间") @RequestParam(required = false) String endTime,
@ApiParam(required = false, value = "商品編碼") @RequestParam(required = false) String goodsNo,
@ApiParam(required = false, value = "页码", defaultValue = "1") @RequestParam(required = false, value = "page") Integer page, @ApiParam(required = false, value = "页码", defaultValue = "1") @RequestParam(required = false, value = "page") Integer page,
@ApiParam(required = false, value = "每页条数", defaultValue = "10") @RequestParam(required = false, value = "pageSize") Integer pageSize, @ApiParam(required = false, value = "每页条数", defaultValue = "10") @RequestParam(required = false, value = "pageSize") Integer pageSize,
HttpServletRequest request) { HttpServletRequest request) {
@ -590,7 +589,6 @@ public class ReceiptRecordsApi extends BaseController {
params.put("areaId", areaId); params.put("areaId", areaId);
params.put("page", page); params.put("page", page);
params.put("pageSize", pageSize); params.put("pageSize", pageSize);
params.put("goodsNo",goodsNo);
// 分页查询在发货单或者收发货记录中有记录的经销商 // 分页查询在发货单或者收发货记录中有记录的经销商
PageInfo pageInfo = receiptRecordsService.pageList(params, ".customerRecords1"); PageInfo pageInfo = receiptRecordsService.pageList(params, ".customerRecords1");
List<Map<String, Object>> list = pageInfo.getList(); List<Map<String, Object>> list = pageInfo.getList();

View File

@ -97,9 +97,6 @@ public class ReceiptRecordsController extends BaseController {
params.put("endTime", endTime); params.put("endTime", endTime);
params.put("startDate", startDate); params.put("startDate", startDate);
params.put("endDate", endDate); params.put("endDate", endDate);
params.put("goodsNo", goodsNo);
params.put("goodsName", goodsName);
params.put("specifications", specifications);
params.put("page", pageNum); params.put("page", pageNum);
params.put("pageSize", pageSize); params.put("pageSize", pageSize);
return toPage(receiptRecordsService.pageList(params, ".findRecordsByCondition")); return toPage(receiptRecordsService.pageList(params, ".findRecordsByCondition"));
@ -162,7 +159,6 @@ public class ReceiptRecordsController extends BaseController {
@ApiParam(required = false, value = "业务员id(逗号分隔)") @RequestParam(required = false) String staffIds, @ApiParam(required = false, value = "业务员id(逗号分隔)") @RequestParam(required = false) String staffIds,
@ApiParam(required = false, value = "开始时间") @RequestParam(required = false) String startTime, @ApiParam(required = false, value = "开始时间") @RequestParam(required = false) String startTime,
@ApiParam(required = false, value = "结束时间") @RequestParam(required = false) String endTime, @ApiParam(required = false, value = "结束时间") @RequestParam(required = false) String endTime,
@ApiParam(required = false, value = "商品編碼") @RequestParam(required = false) String goodsNo,
@ApiParam(required = false, value = "页码", defaultValue = "1") @RequestParam(required = false, value = "page") Integer page, @ApiParam(required = false, value = "页码", defaultValue = "1") @RequestParam(required = false, value = "page") Integer page,
@ApiParam(required = false, value = "每页条数", defaultValue = "10") @RequestParam(required = false, value = "pageSize") Integer pageSize, @ApiParam(required = false, value = "每页条数", defaultValue = "10") @RequestParam(required = false, value = "pageSize") Integer pageSize,
HttpServletRequest request) { HttpServletRequest request) {
@ -183,7 +179,6 @@ public class ReceiptRecordsController extends BaseController {
params.put("staffName", staffName); params.put("staffName", staffName);
params.put("startTime", startTime); params.put("startTime", startTime);
params.put("endTime", endTime); params.put("endTime", endTime);
params.put("goodsNo",goodsNo);
if (StringUtil.isNotEmpty(areaIds)) { if (StringUtil.isNotEmpty(areaIds)) {
params.put("areaIds", areaIds.split(",", -1)); params.put("areaIds", areaIds.split(",", -1));
} }
@ -227,7 +222,6 @@ public class ReceiptRecordsController extends BaseController {
@ApiParam(required = false, value = "业务员id(逗号分隔)") @RequestParam(required = false) String staffIds, @ApiParam(required = false, value = "业务员id(逗号分隔)") @RequestParam(required = false) String staffIds,
@ApiParam(required = false, value = "开始时间") @RequestParam(required = false) String startTime, @ApiParam(required = false, value = "开始时间") @RequestParam(required = false) String startTime,
@ApiParam(required = false, value = "结束时间") @RequestParam(required = false) String endTime, @ApiParam(required = false, value = "结束时间") @RequestParam(required = false) String endTime,
@ApiParam(required = false, value = "商品編碼") @RequestParam(required = false) String goodsNo,
HttpServletRequest request) { HttpServletRequest request) {
Map<String, Object> result = new HashMap<String, Object>(); Map<String, Object> result = new HashMap<String, Object>();
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
@ -246,7 +240,6 @@ public class ReceiptRecordsController extends BaseController {
map.put("endCode", endCode); map.put("endCode", endCode);
map.put("clientId", clientId); map.put("clientId", clientId);
map.put("clientName", clientName); map.put("clientName", clientName);
map.put("goodsNo", goodsNo);
if (StringUtil.isNotEmpty(areaIds)) { if (StringUtil.isNotEmpty(areaIds)) {
map.put("areaIds", areaIds.split(",", -1)); map.put("areaIds", areaIds.split(",", -1));
} }

View File

@ -124,9 +124,6 @@
<if test="goodsNo != null and goodsNo != ''"> <if test="goodsNo != null and goodsNo != ''">
AND a.GOODS_NO = #{goodsNo} AND a.GOODS_NO = #{goodsNo}
</if> </if>
<if test="(goodsNo == null or goodsNo == '') and (isAll == null or isAll == '')">
AND (a.GOODS_NO is null or a.GOODS_NO = '')
</if>
<if test="clientId != null and clientId != ''"> <if test="clientId != null and clientId != ''">
AND c.client_id = #{clientId} AND c.client_id = #{clientId}
</if> </if>

View File

@ -261,30 +261,6 @@
<where> <where>
AND (a.invoice_time is not null) AND (a.invoice_time is not null)
AND (a.invoice_client_id is not null) AND (a.invoice_client_id is not null)
<if test="goodsNo != null and goodsNo != ''">
AND a.GOODS_NO = #{goodsNo}
</if>
<if test="isAll != null">
and a.INVOICE_CLIENT_ID in
( SELECT client_id FROM crm_total_records
<where>
<if test="invoiceStartTime != null and invoiceStartTime != ''">
AND TO_CHAR(TO_DATE(SUBSTR(create_time,1,10),'yyyy-MM-dd'),'yyyy-MM-dd') &gt;=
TO_CHAR(TO_DATE(SUBSTR(#{invoiceStartTime},1,10),'yyyy-MM-dd'),'yyyy-MM-dd')
</if>
<if test="invoiceEndTime != null and invoiceEndTime != ''">
AND TO_CHAR(TO_DATE(SUBSTR(create_time,1,10),'yyyy-MM-dd'),'yyyy-MM-dd') &lt;=
TO_CHAR(TO_DATE(SUBSTR(#{invoiceEndTime},1,10),'yyyy-MM-dd'),'yyyy-MM-dd')
</if>
</where>
)
</if>
<if test="(goodsNo == null or goodsNo == '') and (isAll == null or isAll == '')">
AND (a.GOODS_NO is null or a.GOODS_NO = '')
</if>
<if test="isAll != null and isAll != ''">
and a.GOODS_NO is not null
</if>
<if test="companyId != null and companyId != ''"> <if test="companyId != null and companyId != ''">
AND a.company_id = #{companyId} AND a.company_id = #{companyId}
</if> </if>
@ -412,10 +388,7 @@
</if> </if>
</if> </if>
</where> </where>
<if test="isAll == null or isAll == ''"> ORDER BY a.create_time DESC
group by GOODS_NO
</if>
-- ORDER BY a.create_time DESC
</select> </select>
<!-- 入库/出库 --> <!-- 入库/出库 -->
@ -425,38 +398,6 @@
FROM crm_receipt_records a FROM crm_receipt_records a
LEFT JOIN crm_distributor_user_info b on a.client_id = b.id LEFT JOIN crm_distributor_user_info b on a.client_id = b.id
<where> <where>
<if test="goodsNo != null and goodsNo != ''">
AND a.GOODS_NO = #{goodsNo}
</if>
<if test="isAll != null">
and a.CLIENT_ID in
( SELECT client_id FROM crm_total_records
<where>
<if test="receiveStartTime != null and receiveStartTime != ''">
AND TO_CHAR(TO_DATE(SUBSTR(create_time,1,10),'yyyy-MM-dd'),'yyyy-MM-dd') &gt;=
TO_CHAR(TO_DATE(SUBSTR(#{receiveStartTime},1,10),'yyyy-MM-dd'),'yyyy-MM-dd')
</if>
<if test="receiveEndTime != null and receiveEndTime != ''">
AND TO_CHAR(TO_DATE(SUBSTR(create_time,1,10),'yyyy-MM-dd'),'yyyy-MM-dd') &lt;=
TO_CHAR(TO_DATE(SUBSTR(#{receiveEndTime},1,10),'yyyy-MM-dd'),'yyyy-MM-dd')
</if>
<if test="deliveryStartTime != null and deliveryStartTime != ''">
AND TO_CHAR(TO_DATE(SUBSTR(create_time,1,10),'yyyy-MM-dd'),'yyyy-MM-dd') &gt;=
TO_CHAR(TO_DATE(SUBSTR(#{deliveryStartTime},1,10),'yyyy-MM-dd'),'yyyy-MM-dd')
</if>
<if test="deliveryEndTime != null and deliveryEndTime != ''">
AND TO_CHAR(TO_DATE(SUBSTR(create_time,1,10),'yyyy-MM-dd'),'yyyy-MM-dd') &lt;=
TO_CHAR(TO_DATE(SUBSTR(#{deliveryEndTime},1,10),'yyyy-MM-dd'),'yyyy-MM-dd')
</if>
</where>
)
</if>
<if test="(goodsNo == null or goodsNo == '') and (isAll == null or isAll == '')">
AND (a.GOODS_NO is null or a.GOODS_NO = '')
</if>
<if test="isAll != null and isAll != ''">
and a.GOODS_NO is not null
</if>
<if test="companyId != null and companyId != ''"> <if test="companyId != null and companyId != ''">
AND a.company_id = #{companyId} AND a.company_id = #{companyId}
</if> </if>
@ -599,9 +540,6 @@
</if> </if>
</if> </if>
</where> </where>
<if test="isAll == null or isAll == ''">
group by GOODS_NO
</if>
</select> </select>
<select id="oneById" resultMap="recordsMap" parameterType="map"> <select id="oneById" resultMap="recordsMap" parameterType="map">
@ -1020,7 +958,7 @@
</select> </select>
<select id="customerRecords1" resultType="map" parameterType="map"> <select id="customerRecords1" resultType="map" parameterType="map">
select a.*,b.GOODS_NO "goodsNo",b.GOODS_NAME "goodsName",b.SPECIFICATION "specification" from (SELECT SELECT
a.CLIENT_ID "clientId", a.CLIENT_ID "clientId",
MAX( b.distributor_name ) "clientName", MAX( b.distributor_name ) "clientName",
MAX( b.marketing_area_id ) "areaId", MAX( b.marketing_area_id ) "areaId",
@ -1157,12 +1095,6 @@
</if> </if>
</if> </if>
GROUP BY a.CLIENT_ID GROUP BY a.CLIENT_ID
) a cross join crm_invoice_goods b
<where>
<if test="goodsNo != null and goodsNo != ''">
b.GOODS_NO = #{goodsNo}
</if>
</where>
</select> </select>
<insert id="addCustomerCom" parameterType="map"> <insert id="addCustomerCom" parameterType="map">

View File

@ -31,24 +31,6 @@ public class ReceiptRecordsBo implements java.io.Serializable {
@Excel(name = "U8编码", width = 15, orderNum = "2") @Excel(name = "U8编码", width = 15, orderNum = "2")
private String uecode; private String uecode;
/**
* 商品编码
*/
@Excel(name = "商品编码", width = 15, orderNum = "4")
private String goodsNo;
/**
* 商品名称
*/
@Excel(name = "商品名称", width = 15, orderNum = "5")
private String goodsName;
/**
* 规格
*/
@Excel(name = "规格", width = 15, orderNum = "6")
private String specification;
/** /**
* 营销区域id * 营销区域id
*/ */
@ -125,30 +107,6 @@ public class ReceiptRecordsBo implements java.io.Serializable {
@Excel(name = "出库数量", width = 15, orderNum = "10") @Excel(name = "出库数量", width = 15, orderNum = "10")
private String deliveryNum; private String deliveryNum;
public String getGoodsNo() {
return goodsNo;
}
public void setGoodsNo(String goodsNo) {
this.goodsNo = goodsNo;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public String getSpecification() {
return specification;
}
public void setSpecification(String specification) {
this.specification = specification;
}
/** /**
* 入库率 入库数量/实发数量*100 * 入库率 入库数量/实发数量*100
*/ */

View File

@ -259,7 +259,6 @@ public class ReceiptRecordsService {
map.put("endCode", endCode); map.put("endCode", endCode);
map.put("startTime", startTime); map.put("startTime", startTime);
map.put("endTime", endTime); map.put("endTime", endTime);
map.put("goodsNo", objectMap.get("goodsNo"));
List list2 = this.findGoods(map, ".getMajorNum"); List list2 = this.findGoods(map, ".getMajorNum");
Map map1 = (Map) list2.get(0); Map map1 = (Map) list2.get(0);
if (map1 != null) { if (map1 != null) {
@ -276,7 +275,6 @@ public class ReceiptRecordsService {
map.put("endCode", endCode); map.put("endCode", endCode);
map.put("invoiceStartTime", startTime); map.put("invoiceStartTime", startTime);
map.put("invoiceEndTime", endTime); map.put("invoiceEndTime", endTime);
map.put("goodsNo", objectMap.get("goodsNo"));
Integer invoiceNum = this.countAll(map, ".countRecordsByCondition"); Integer invoiceNum = this.countAll(map, ".countRecordsByCondition");
invoiceNum = StringUtil.isNullOrEmpty(invoiceNum)? 0:invoiceNum; invoiceNum = StringUtil.isNullOrEmpty(invoiceNum)? 0:invoiceNum;
// receiptRecordsBo.setInvoiceNum(invoiceNum.toString()); // receiptRecordsBo.setInvoiceNum(invoiceNum.toString());
@ -289,7 +287,6 @@ public class ReceiptRecordsService {
map.put("receiveStartTime", startTime); map.put("receiveStartTime", startTime);
map.put("receiveEndTime", endTime); map.put("receiveEndTime", endTime);
map.put("timeFlag", "1"); map.put("timeFlag", "1");
map.put("goodsNo", objectMap.get("goodsNo"));
Integer receiveNum = this.countAll(map, ".statisticsRecords"); Integer receiveNum = this.countAll(map, ".statisticsRecords");
receiveNum = StringUtil.isNullOrEmpty(receiveNum)? 0:receiveNum; receiveNum = StringUtil.isNullOrEmpty(receiveNum)? 0:receiveNum;
// receiptRecordsBo.setReceiveNum(receiveNum.toString()); // receiptRecordsBo.setReceiveNum(receiveNum.toString());
@ -302,7 +299,6 @@ public class ReceiptRecordsService {
map.put("deliveryStartTime", startTime); map.put("deliveryStartTime", startTime);
map.put("deliveryEndTime", endTime); map.put("deliveryEndTime", endTime);
map.put("timeFlag", "2"); map.put("timeFlag", "2");
map.put("goodsNo", objectMap.get("goodsNo"));
Integer deliveryNum = this.countAll(map, ".statisticsRecords"); Integer deliveryNum = this.countAll(map, ".statisticsRecords");
deliveryNum = StringUtil.isNullOrEmpty(deliveryNum)? 0:deliveryNum; deliveryNum = StringUtil.isNullOrEmpty(deliveryNum)? 0:deliveryNum;
// receiptRecordsBo.setDeliveryNum(deliveryNum.toString()); // receiptRecordsBo.setDeliveryNum(deliveryNum.toString());
@ -334,7 +330,6 @@ public class ReceiptRecordsService {
// 应发数量 发货单的商品的实发数量汇总 // 应发数量 发货单的商品的实发数量汇总
map.put("startTime", startTime); map.put("startTime", startTime);
map.put("endTime", endTime); map.put("endTime", endTime);
map.put("isAll", "1");
// List list2 = invoiceService.findList(map, ".countNum"); // List list2 = invoiceService.findList(map, ".countNum");
List list2 = this.findGoods(map, ".getMajorNum"); List list2 = this.findGoods(map, ".getMajorNum");
Map map1 = (Map) list2.get(0); Map map1 = (Map) list2.get(0);
@ -351,7 +346,6 @@ public class ReceiptRecordsService {
map.putAll(params); map.putAll(params);
map.put("invoiceStartTime", startTime); map.put("invoiceStartTime", startTime);
map.put("invoiceEndTime", endTime); map.put("invoiceEndTime", endTime);
map.put("isAll", "1");
Integer invoiceNum = this.countAll(map, ".countRecordsByCondition"); Integer invoiceNum = this.countAll(map, ".countRecordsByCondition");
receiptRecordsBo.setInvoiceNum(StringUtil.isNullOrEmpty(invoiceNum) ? "0":invoiceNum+""); receiptRecordsBo.setInvoiceNum(StringUtil.isNullOrEmpty(invoiceNum) ? "0":invoiceNum+"");