优化报表的排序逻辑

This commit is contained in:
jishenghua
2023-12-25 23:41:33 +08:00
parent 9f738b51b4
commit 313f101a82
7 changed files with 131 additions and 114 deletions

View File

@@ -6,40 +6,31 @@ import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.constants.ExceptionConstants; import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.DepotHead; import com.jsh.erp.datasource.entities.DepotHead;
import com.jsh.erp.datasource.entities.DepotHeadVo4Body; import com.jsh.erp.datasource.entities.DepotHeadVo4Body;
import com.jsh.erp.datasource.entities.Supplier;
import com.jsh.erp.datasource.vo.DepotHeadVo4InDetail; import com.jsh.erp.datasource.vo.DepotHeadVo4InDetail;
import com.jsh.erp.datasource.vo.DepotHeadVo4InOutMCount; import com.jsh.erp.datasource.vo.DepotHeadVo4InOutMCount;
import com.jsh.erp.datasource.vo.DepotHeadVo4List; import com.jsh.erp.datasource.vo.DepotHeadVo4List;
import com.jsh.erp.datasource.vo.DepotHeadVo4StatementAccount; import com.jsh.erp.datasource.vo.DepotHeadVo4StatementAccount;
import com.jsh.erp.exception.BusinessParamCheckingException;
import com.jsh.erp.service.accountHead.AccountHeadService;
import com.jsh.erp.service.depot.DepotService; import com.jsh.erp.service.depot.DepotService;
import com.jsh.erp.service.depotHead.DepotHeadService; import com.jsh.erp.service.depotHead.DepotHeadService;
import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.redis.RedisService; import com.jsh.erp.service.redis.RedisService;
import com.jsh.erp.service.supplier.SupplierService;
import com.jsh.erp.service.systemConfig.SystemConfigService; import com.jsh.erp.service.systemConfig.SystemConfigService;
import com.jsh.erp.utils.*; import com.jsh.erp.utils.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.sql.Date;
import java.text.DecimalFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson; import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
import static com.jsh.erp.utils.Tools.getNow3;
/** /**
* @author ji-sheng-hua 752*718*920 * @author ji-sheng-hua 752*718*920
@@ -59,9 +50,6 @@ public class DepotHeadController {
@Resource @Resource
private SystemConfigService systemConfigService; private SystemConfigService systemConfigService;
@Resource
private RedisService redisService;
/** /**
* 批量设置状态-审核或者反审核 * 批量设置状态-审核或者反审核
* @param jsonObject * @param jsonObject
@@ -100,17 +88,19 @@ public class DepotHeadController {
@GetMapping(value = "/findInOutDetail") @GetMapping(value = "/findInOutDetail")
@ApiOperation(value = "入库出库明细接口") @ApiOperation(value = "入库出库明细接口")
public BaseResponseInfo findInOutDetail(@RequestParam("currentPage") Integer currentPage, public BaseResponseInfo findInOutDetail(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam(value = "organId", required = false) Integer oId, @RequestParam(value = "organId", required = false) Integer oId,
@RequestParam("number") String number, @RequestParam("number") String number,
@RequestParam("materialParam") String materialParam, @RequestParam("materialParam") String materialParam,
@RequestParam(value = "depotId", required = false) Long depotId, @RequestParam(value = "depotId", required = false) Long depotId,
@RequestParam("beginTime") String beginTime, @RequestParam("beginTime") String beginTime,
@RequestParam("endTime") String endTime, @RequestParam("endTime") String endTime,
@RequestParam("type") String type, @RequestParam("type") String type,
@RequestParam(value = "creator", required = false) Long creator, @RequestParam(value = "creator", required = false) Long creator,
@RequestParam("remark") String remark, @RequestParam("remark") String remark,
HttpServletRequest request)throws Exception { @RequestParam(value = "column", required = false) String column,
@RequestParam(value = "order", required = false) String order,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
@@ -134,7 +124,8 @@ public class DepotHeadController {
Boolean forceFlag = systemConfigService.getForceApprovalFlag(); Boolean forceFlag = systemConfigService.getForceApprovalFlag();
Boolean inOutManageFlag = systemConfigService.getInOutManageFlag(); Boolean inOutManageFlag = systemConfigService.getInOutManageFlag();
List<DepotHeadVo4InDetail> list = depotHeadService.findInOutDetail(beginTime, endTime, type, creatorArray, organArray, forceFlag, inOutManageFlag, List<DepotHeadVo4InDetail> list = depotHeadService.findInOutDetail(beginTime, endTime, type, creatorArray, organArray, forceFlag, inOutManageFlag,
StringUtil.toNull(materialParam), depotList, oId, StringUtil.toNull(number), creator, remark, (currentPage-1)*pageSize, pageSize); StringUtil.toNull(materialParam), depotList, oId, StringUtil.toNull(number), creator, remark,
StringUtil.safeSqlParse(column), StringUtil.safeSqlParse(order), (currentPage-1)*pageSize, pageSize);
int total = depotHeadService.findInOutDetailCount(beginTime, endTime, type, creatorArray, organArray, forceFlag, inOutManageFlag, int total = depotHeadService.findInOutDetailCount(beginTime, endTime, type, creatorArray, organArray, forceFlag, inOutManageFlag,
StringUtil.toNull(materialParam), depotList, oId, StringUtil.toNull(number), creator, remark); StringUtil.toNull(materialParam), depotList, oId, StringUtil.toNull(number), creator, remark);
map.put("total", total); map.put("total", total);
@@ -171,14 +162,16 @@ public class DepotHeadController {
@GetMapping(value = "/findInOutMaterialCount") @GetMapping(value = "/findInOutMaterialCount")
@ApiOperation(value = "入库出库统计接口") @ApiOperation(value = "入库出库统计接口")
public BaseResponseInfo findInOutMaterialCount(@RequestParam("currentPage") Integer currentPage, public BaseResponseInfo findInOutMaterialCount(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize, @RequestParam("pageSize") Integer pageSize,
@RequestParam(value = "organId", required = false) Integer oId, @RequestParam(value = "organId", required = false) Integer oId,
@RequestParam("materialParam") String materialParam, @RequestParam("materialParam") String materialParam,
@RequestParam(value = "depotId", required = false) Long depotId, @RequestParam(value = "depotId", required = false) Long depotId,
@RequestParam("beginTime") String beginTime, @RequestParam("beginTime") String beginTime,
@RequestParam("endTime") String endTime, @RequestParam("endTime") String endTime,
@RequestParam("type") String type, @RequestParam("type") String type,
HttpServletRequest request)throws Exception { @RequestParam(value = "column", required = false) String column,
@RequestParam(value = "order", required = false) String order,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
try { try {
@@ -198,7 +191,8 @@ public class DepotHeadController {
Boolean forceFlag = systemConfigService.getForceApprovalFlag(); Boolean forceFlag = systemConfigService.getForceApprovalFlag();
Boolean inOutManageFlag = systemConfigService.getInOutManageFlag(); Boolean inOutManageFlag = systemConfigService.getInOutManageFlag();
List<DepotHeadVo4InOutMCount> list = depotHeadService.findInOutMaterialCount(beginTime, endTime, type, forceFlag, inOutManageFlag, List<DepotHeadVo4InOutMCount> list = depotHeadService.findInOutMaterialCount(beginTime, endTime, type, forceFlag, inOutManageFlag,
StringUtil.toNull(materialParam), depotList, oId, (currentPage-1)*pageSize, pageSize); StringUtil.toNull(materialParam), depotList, oId, StringUtil.safeSqlParse(column), StringUtil.safeSqlParse(order),
(currentPage-1)*pageSize, pageSize);
int total = depotHeadService.findInOutMaterialCountTotal(beginTime, endTime, type, forceFlag, inOutManageFlag, int total = depotHeadService.findInOutMaterialCountTotal(beginTime, endTime, type, forceFlag, inOutManageFlag,
StringUtil.toNull(materialParam), depotList, oId); StringUtil.toNull(materialParam), depotList, oId);
map.put("total", total); map.put("total", total);
@@ -239,6 +233,8 @@ public class DepotHeadController {
@RequestParam("endTime") String endTime, @RequestParam("endTime") String endTime,
@RequestParam("subType") String subType, @RequestParam("subType") String subType,
@RequestParam("remark") String remark, @RequestParam("remark") String remark,
@RequestParam(value = "column", required = false) String column,
@RequestParam(value = "order", required = false) String order,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
@@ -270,7 +266,8 @@ public class DepotHeadController {
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
Boolean forceFlag = systemConfigService.getForceApprovalFlag(); Boolean forceFlag = systemConfigService.getForceApprovalFlag();
List<DepotHeadVo4InDetail> list = depotHeadService.findAllocationDetail(beginTime, endTime, subType, StringUtil.toNull(number), List<DepotHeadVo4InDetail> list = depotHeadService.findAllocationDetail(beginTime, endTime, subType, StringUtil.toNull(number),
creatorArray, forceFlag, StringUtil.toNull(materialParam), depotList, depotFList, remark, (currentPage-1)*pageSize, pageSize); creatorArray, forceFlag, StringUtil.toNull(materialParam), depotList, depotFList, remark,
StringUtil.safeSqlParse(column), StringUtil.safeSqlParse(order), (currentPage-1)*pageSize, pageSize);
int total = depotHeadService.findAllocationDetailCount(beginTime, endTime, subType, StringUtil.toNull(number), int total = depotHeadService.findAllocationDetailCount(beginTime, endTime, subType, StringUtil.toNull(number),
creatorArray, forceFlag, StringUtil.toNull(materialParam), depotList, depotFList, remark); creatorArray, forceFlag, StringUtil.toNull(materialParam), depotList, depotFList, remark);
map.put("rows", list); map.put("rows", list);

View File

@@ -595,9 +595,8 @@ public class MaterialController {
@RequestParam(value = "position", required = false) String position, @RequestParam(value = "position", required = false) String position,
@RequestParam("materialParam") String materialParam, @RequestParam("materialParam") String materialParam,
@RequestParam("zeroStock") Integer zeroStock, @RequestParam("zeroStock") Integer zeroStock,
@RequestParam("mpList") String mpList, @RequestParam(value = "column", required = false) String column,
@RequestParam("column") String column, @RequestParam(value = "order", required = false) String order,
@RequestParam("order") String order,
HttpServletRequest request)throws Exception { HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo(); BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();

View File

@@ -77,6 +77,8 @@ public interface DepotHeadMapperEx {
@Param("number") String number, @Param("number") String number,
@Param("creator") Long creator, @Param("creator") Long creator,
@Param("remark") String remark, @Param("remark") String remark,
@Param("column") String column,
@Param("order") String order,
@Param("offset") Integer offset, @Param("offset") Integer offset,
@Param("rows") Integer rows); @Param("rows") Integer rows);
@@ -106,6 +108,8 @@ public interface DepotHeadMapperEx {
@Param("oId") Integer oId, @Param("oId") Integer oId,
@Param("creatorArray") String[] creatorArray, @Param("creatorArray") String[] creatorArray,
@Param("organArray") String[] organArray, @Param("organArray") String[] organArray,
@Param("column") String column,
@Param("order") String order,
@Param("offset") Integer offset, @Param("offset") Integer offset,
@Param("rows") Integer rows); @Param("rows") Integer rows);
@@ -132,6 +136,8 @@ public interface DepotHeadMapperEx {
@Param("depotList") List<Long> depotList, @Param("depotList") List<Long> depotList,
@Param("depotFList") List<Long> depotFList, @Param("depotFList") List<Long> depotFList,
@Param("remark") String remark, @Param("remark") String remark,
@Param("column") String column,
@Param("order") String order,
@Param("offset") Integer offset, @Param("offset") Integer offset,
@Param("rows") Integer rows); @Param("rows") Integer rows);

View File

@@ -6,25 +6,25 @@ import java.util.Date;
public class DepotHeadVo4InDetail { public class DepotHeadVo4InDetail {
private String Number; private String number;
private String barCode; private String barCode;
private String MName; private String mname;
private String Model; private String model;
private String standard; private String standard;
private BigDecimal UnitPrice; private BigDecimal unitPrice;
private String mUnit; private String mUnit;
private String newRemark; private String newRemark;
private BigDecimal OperNumber; private BigDecimal operNumber;
private BigDecimal AllPrice; private BigDecimal allPrice;
private BigDecimal taxRate; private BigDecimal taxRate;
@@ -32,22 +32,22 @@ public class DepotHeadVo4InDetail {
private BigDecimal taxLastMoney; private BigDecimal taxLastMoney;
private String SName; private String sname;
private String DName; private String dname;
private String OperTime; private String operTime;
private String NewType; private String newType;
private Long tenantId; private Long tenantId;
public String getNumber() { public String getNumber() {
return Number; return number;
} }
public void setNumber(String number) { public void setNumber(String number) {
Number = number; this.number = number;
} }
public String getBarCode() { public String getBarCode() {
@@ -58,20 +58,20 @@ public class DepotHeadVo4InDetail {
this.barCode = barCode; this.barCode = barCode;
} }
public String getMName() { public String getMname() {
return MName; return mname;
} }
public void setMName(String MName) { public void setMname(String mname) {
this.MName = MName; this.mname = mname;
} }
public String getModel() { public String getModel() {
return Model; return model;
} }
public void setModel(String model) { public void setModel(String model) {
Model = model; this.model = model;
} }
public String getStandard() { public String getStandard() {
@@ -83,11 +83,11 @@ public class DepotHeadVo4InDetail {
} }
public BigDecimal getUnitPrice() { public BigDecimal getUnitPrice() {
return UnitPrice; return unitPrice;
} }
public void setUnitPrice(BigDecimal unitPrice) { public void setUnitPrice(BigDecimal unitPrice) {
UnitPrice = unitPrice; this.unitPrice = unitPrice;
} }
public String getmUnit() { public String getmUnit() {
@@ -107,19 +107,19 @@ public class DepotHeadVo4InDetail {
} }
public BigDecimal getOperNumber() { public BigDecimal getOperNumber() {
return OperNumber; return operNumber;
} }
public void setOperNumber(BigDecimal operNumber) { public void setOperNumber(BigDecimal operNumber) {
OperNumber = operNumber; this.operNumber = operNumber;
} }
public BigDecimal getAllPrice() { public BigDecimal getAllPrice() {
return AllPrice; return allPrice;
} }
public void setAllPrice(BigDecimal allPrice) { public void setAllPrice(BigDecimal allPrice) {
AllPrice = allPrice; this.allPrice = allPrice;
} }
public BigDecimal getTaxRate() { public BigDecimal getTaxRate() {
@@ -146,36 +146,36 @@ public class DepotHeadVo4InDetail {
this.taxLastMoney = taxLastMoney; this.taxLastMoney = taxLastMoney;
} }
public String getSName() { public String getSname() {
return SName; return sname;
} }
public void setSName(String SName) { public void setSname(String sname) {
this.SName = SName; this.sname = sname;
} }
public String getDName() { public String getDname() {
return DName; return dname;
} }
public void setDName(String DName) { public void setDname(String dname) {
this.DName = DName; this.dname = dname;
} }
public String getOperTime() { public String getOperTime() {
return OperTime; return operTime;
} }
public void setOperTime(String operTime) { public void setOperTime(String operTime) {
OperTime = operTime; this.operTime = operTime;
} }
public String getNewType() { public String getNewType() {
return NewType; return newType;
} }
public void setNewType(String newType) { public void setNewType(String newType) {
NewType = newType; this.newType = newType;
} }
public Long getTenantId() { public Long getTenantId() {

View File

@@ -1,17 +1,16 @@
package com.jsh.erp.datasource.vo; package com.jsh.erp.datasource.vo;
import java.math.BigDecimal; import java.math.BigDecimal;
public class DepotHeadVo4InOutMCount { public class DepotHeadVo4InOutMCount {
private Long MaterialId; private Long materialId;
private String barCode; private String barCode;
private String mName; private String mName;
private String Model; private String model;
private String standard; private String standard;
@@ -26,11 +25,11 @@ public class DepotHeadVo4InOutMCount {
private Long tenantId; private Long tenantId;
public Long getMaterialId() { public Long getMaterialId() {
return MaterialId; return materialId;
} }
public void setMaterialId(Long materialId) { public void setMaterialId(Long materialId) {
MaterialId = materialId; this.materialId = materialId;
} }
public String getBarCode() { public String getBarCode() {
@@ -50,11 +49,11 @@ public class DepotHeadVo4InOutMCount {
} }
public String getModel() { public String getModel() {
return Model; return model;
} }
public void setModel(String model) { public void setModel(String model) {
Model = model; this.model = model;
} }
public String getStandard() { public String getStandard() {

View File

@@ -660,11 +660,11 @@ public class DepotHeadService {
public List<DepotHeadVo4InDetail> findInOutDetail(String beginTime, String endTime, String type, String [] creatorArray, public List<DepotHeadVo4InDetail> findInOutDetail(String beginTime, String endTime, String type, String [] creatorArray,
String [] organArray, Boolean forceFlag, Boolean inOutManageFlag, String [] organArray, Boolean forceFlag, Boolean inOutManageFlag,
String materialParam, List<Long> depotList, Integer oId, String number, String materialParam, List<Long> depotList, Integer oId, String number,
Long creator, String remark, Integer offset, Integer rows) throws Exception{ Long creator, String remark, String column, String order, Integer offset, Integer rows) throws Exception{
List<DepotHeadVo4InDetail> list = null; List<DepotHeadVo4InDetail> list = null;
try{ try{
list =depotHeadMapperEx.findInOutDetail(beginTime, endTime, type, creatorArray, organArray, forceFlag, inOutManageFlag, list =depotHeadMapperEx.findInOutDetail(beginTime, endTime, type, creatorArray, organArray, forceFlag, inOutManageFlag,
materialParam, depotList, oId, number, creator, remark, offset, rows); materialParam, depotList, oId, number, creator, remark, column, order, offset, rows);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
@@ -686,14 +686,15 @@ public class DepotHeadService {
public List<DepotHeadVo4InOutMCount> findInOutMaterialCount(String beginTime, String endTime, String type, public List<DepotHeadVo4InOutMCount> findInOutMaterialCount(String beginTime, String endTime, String type,
Boolean forceFlag, Boolean inOutManageFlag, String materialParam, Boolean forceFlag, Boolean inOutManageFlag, String materialParam,
List<Long> depotList, Integer oId, Integer offset, Integer rows)throws Exception { List<Long> depotList, Integer oId, String column, String order,
Integer offset, Integer rows)throws Exception {
List<DepotHeadVo4InOutMCount> list = null; List<DepotHeadVo4InOutMCount> list = null;
try{ try{
String [] creatorArray = getCreatorArray(); String [] creatorArray = getCreatorArray();
String subType = "出库".equals(type)? "销售" : ""; String subType = "出库".equals(type)? "销售" : "";
String [] organArray = getOrganArray(subType, ""); String [] organArray = getOrganArray(subType, "");
list =depotHeadMapperEx.findInOutMaterialCount(beginTime, endTime, type, forceFlag, inOutManageFlag, materialParam, depotList, oId, list =depotHeadMapperEx.findInOutMaterialCount(beginTime, endTime, type, forceFlag, inOutManageFlag, materialParam, depotList, oId,
creatorArray, organArray, offset, rows); creatorArray, organArray, column, order, offset, rows);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
@@ -718,11 +719,11 @@ public class DepotHeadService {
public List<DepotHeadVo4InDetail> findAllocationDetail(String beginTime, String endTime, String subType, String number, public List<DepotHeadVo4InDetail> findAllocationDetail(String beginTime, String endTime, String subType, String number,
String [] creatorArray, Boolean forceFlag, String materialParam, List<Long> depotList, List<Long> depotFList, String [] creatorArray, Boolean forceFlag, String materialParam, List<Long> depotList, List<Long> depotFList,
String remark, Integer offset, Integer rows) throws Exception{ String remark, String column, String order, Integer offset, Integer rows) throws Exception{
List<DepotHeadVo4InDetail> list = null; List<DepotHeadVo4InDetail> list = null;
try{ try{
list =depotHeadMapperEx.findAllocationDetail(beginTime, endTime, subType, number, creatorArray, forceFlag, list =depotHeadMapperEx.findAllocationDetail(beginTime, endTime, subType, number, creatorArray, forceFlag,
materialParam, depotList, depotFList, remark, offset, rows); materialParam, depotList, depotFList, remark, column, order, offset, rows);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }

View File

@@ -13,28 +13,28 @@
</resultMap> </resultMap>
<resultMap id="ResultWithInfoExMap" type="com.jsh.erp.datasource.vo.DepotHeadVo4InDetail"> <resultMap id="ResultWithInfoExMap" type="com.jsh.erp.datasource.vo.DepotHeadVo4InDetail">
<result column="Number" jdbcType="VARCHAR" property="Number" /> <result column="number" jdbcType="VARCHAR" property="number" />
<result column="bar_code" jdbcType="VARCHAR" property="barCode" /> <result column="barCode" jdbcType="VARCHAR" property="barCode" />
<result column="MName" jdbcType="VARCHAR" property="MName" /> <result column="mname" jdbcType="VARCHAR" property="mname" />
<result column="Model" jdbcType="VARCHAR" property="Model" /> <result column="model" jdbcType="VARCHAR" property="model" />
<result column="standard" jdbcType="VARCHAR" property="standard" /> <result column="standard" jdbcType="VARCHAR" property="standard" />
<result column="unit_price" jdbcType="DECIMAL" property="UnitPrice" /> <result column="unitPrice" jdbcType="DECIMAL" property="unitPrice" />
<result column="oper_number" jdbcType="DECIMAL" property="OperNumber" /> <result column="operNumber" jdbcType="DECIMAL" property="operNumber" />
<result column="all_price" jdbcType="DECIMAL" property="AllPrice" /> <result column="allPrice" jdbcType="DECIMAL" property="allPrice" />
<result column="tax_rate" jdbcType="DECIMAL" property="taxRate" /> <result column="taxRate" jdbcType="DECIMAL" property="taxRate" />
<result column="tax_money" jdbcType="DECIMAL" property="taxMoney" /> <result column="taxMoney" jdbcType="DECIMAL" property="taxMoney" />
<result column="tax_last_money" jdbcType="DECIMAL" property="taxLastMoney" /> <result column="taxLastMoney" jdbcType="DECIMAL" property="taxLastMoney" />
<result column="SName" jdbcType="VARCHAR" property="SName" /> <result column="sname" jdbcType="VARCHAR" property="sname" />
<result column="DName" jdbcType="VARCHAR" property="DName" /> <result column="dname" jdbcType="VARCHAR" property="dname" />
<result column="OperTime" jdbcType="VARCHAR" property="OperTime" /> <result column="operTime" jdbcType="VARCHAR" property="operTime" />
<result column="NewType" jdbcType="VARCHAR" property="NewType" /> <result column="newType" jdbcType="VARCHAR" property="newType" />
</resultMap> </resultMap>
<resultMap id="ResultInOutMaterialCount" type="com.jsh.erp.datasource.vo.DepotHeadVo4InOutMCount"> <resultMap id="ResultInOutMaterialCount" type="com.jsh.erp.datasource.vo.DepotHeadVo4InOutMCount">
<result column="MaterialId" jdbcType="BIGINT" property="MaterialId" /> <result column="materialId" jdbcType="BIGINT" property="materialId" />
<result column="bar_code" jdbcType="VARCHAR" property="barCode" /> <result column="barCode" jdbcType="VARCHAR" property="barCode" />
<result column="mName" jdbcType="VARCHAR" property="mName" /> <result column="mName" jdbcType="VARCHAR" property="mName" />
<result column="Model" jdbcType="VARCHAR" property="Model" /> <result column="model" jdbcType="VARCHAR" property="model" />
<result column="standard" jdbcType="VARCHAR" property="standard" /> <result column="standard" jdbcType="VARCHAR" property="standard" />
<result column="categoryName" jdbcType="VARCHAR" property="categoryName" /> <result column="categoryName" jdbcType="VARCHAR" property="categoryName" />
<result column="materialUnit" jdbcType="VARCHAR" property="materialUnit" /> <result column="materialUnit" jdbcType="VARCHAR" property="materialUnit" />
@@ -283,9 +283,9 @@
</select> </select>
<select id="findInOutDetail" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap"> <select id="findInOutDetail" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap">
select dh.number,me.bar_code, m.`name` MName,m.model,m.standard,di.unit_price,di.material_unit as mUnit, select dh.number,me.bar_code barCode, m.name mname,m.model,m.standard,di.unit_price unitPrice,di.material_unit as mUnit,
di.oper_number,di.all_price, ifnull(di.tax_rate,0) tax_rate, ifnull(di.tax_money,0) tax_money, ifnull(di.tax_last_money,0) tax_last_money, di.oper_number operNumber,di.all_price allPrice, ifnull(di.tax_rate,0) taxRate, ifnull(di.tax_money,0) taxMoney, ifnull(di.tax_last_money,0) taxLastMoney,
s.supplier SName,d.dName DName, date_format(dh.oper_time, '%Y-%m-%d') OperTime, concat(dh.sub_type,dh.type) as NewType, s.supplier sname,d.dname dname, date_format(dh.oper_time, '%Y-%m-%d') operTime, concat(dh.sub_type,dh.type) as newType,
concat_ws(' ',dh.remark,di.remark) as newRemark concat_ws(' ',dh.remark,di.remark) as newRemark
from jsh_depot_head dh from jsh_depot_head dh
left join jsh_depot_item di on di.header_id=dh.id and ifnull(di.delete_flag,'0') !='1' left join jsh_depot_item di on di.header_id=dh.id and ifnull(di.delete_flag,'0') !='1'
@@ -343,7 +343,12 @@
</if> </if>
and dh.sub_type!='调拨' and dh.sub_type!='调拨'
and ifnull(dh.delete_flag,'0') !='1' and ifnull(dh.delete_flag,'0') !='1'
ORDER BY oper_time DESC,number desc <if test="column == 'createTime'">
order by oper_time desc,number desc
</if>
<if test="column != 'createTime'">
order by ${column} ${order}
</if>
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
@@ -407,11 +412,10 @@
</if> </if>
and dh.sub_type!='调拨' and dh.sub_type!='调拨'
and ifnull(dh.delete_flag,'0') !='1' and ifnull(dh.delete_flag,'0') !='1'
ORDER BY oper_time DESC,number desc
</select> </select>
<select id="findInOutMaterialCount" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultInOutMaterialCount"> <select id="findInOutMaterialCount" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultInOutMaterialCount">
select di.material_id, me.bar_code, m.name mName,m.Model,m.standard,mc.name categoryName,concat_ws('', m.unit, u.basic_unit) materialUnit, select di.material_id materialId, me.bar_code barCode, m.name mName,m.model,m.standard,mc.name categoryName,concat_ws('', m.unit, u.basic_unit) materialUnit,
sum(di.basic_number) numSum, sum(di.basic_number) numSum,
sum(di.all_price) priceSum sum(di.all_price) priceSum
from jsh_depot_head dh from jsh_depot_head dh
@@ -472,6 +476,12 @@
</if> </if>
and ifnull(dh.delete_flag,'0') !='1' and ifnull(dh.delete_flag,'0') !='1'
group by di.material_id group by di.material_id
<if test="column == 'createTime'">
order by materialId desc
</if>
<if test="column != 'createTime'">
order by ${column} ${order}
</if>
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
@@ -538,15 +548,16 @@
</select> </select>
<select id="findAllocationDetail" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap"> <select id="findAllocationDetail" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap">
select dh.number,me.bar_code, m.`name` MName,m.model,m.standard,di.unit_price,di.material_unit as mUnit,di.oper_number,di.all_price,SName, d.dName DName, select dh.number,me.bar_code barCode, m.name mname,m.model,m.standard,di.unit_price unitPrice,di.material_unit as mUnit,
date_format(dh.oper_time, '%Y-%m-%d') OperTime, concat(dh.sub_type,dh.type) as NewType, concat_ws(' ',dh.remark,di.remark) as newRemark di.oper_number operNumber,di.all_price allPrice,sname, d.dName dname,date_format(dh.oper_time, '%Y-%m-%d') operTime,
concat(dh.sub_type,dh.type) as newType, concat_ws(' ',dh.remark,di.remark) as newRemark
from jsh_depot_head dh from jsh_depot_head dh
left join jsh_depot_item di on di.header_id=dh.id and ifnull(di.delete_flag,'0') !='1' left join jsh_depot_item di on di.header_id=dh.id and ifnull(di.delete_flag,'0') !='1'
left join jsh_material m on m.id=di.material_id and ifnull(m.delete_flag,'0') !='1' left join jsh_material m on m.id=di.material_id and ifnull(m.delete_flag,'0') !='1'
left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1' left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1'
left join (select id,name as dName,delete_Flag from jsh_depot ) d on d.id=di.depot_id and ifnull(d.delete_Flag,'0') !='1' left join (select id,name as dName,delete_Flag from jsh_depot ) d on d.id=di.depot_id and ifnull(d.delete_Flag,'0') !='1'
<!-- 调出仓库名查询 --> <!-- 调出仓库名查询 -->
left join (select id as aid,name as SName,delete_Flag as adelete_Flag from jsh_depot ) ddd on ddd.aid=di.another_depot_id and ifnull(ddd.adelete_Flag,'0') !='1' left join (select id as aid,name as sname,delete_Flag as adelete_Flag from jsh_depot ) ddd on ddd.aid=di.another_depot_id and ifnull(ddd.adelete_Flag,'0') !='1'
where dh.oper_time >=#{beginTime} and dh.oper_time &lt;=#{endTime} where dh.oper_time >=#{beginTime} and dh.oper_time &lt;=#{endTime}
<if test="depotFList.size()>0"> <if test="depotFList.size()>0">
and di.depot_id in and di.depot_id in
@@ -586,7 +597,12 @@
and (dh.remark like #{bindRemark} or di.remark like #{bindRemark}) and (dh.remark like #{bindRemark} or di.remark like #{bindRemark})
</if> </if>
and ifnull(dh.delete_flag,'0') !='1' and ifnull(dh.delete_flag,'0') !='1'
ORDER BY oper_time DESC,number desc <if test="column == 'createTime'">
order by oper_time desc,number desc
</if>
<if test="column != 'createTime'">
order by ${column} ${order}
</if>
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
@@ -638,7 +654,6 @@
and (dh.remark like #{bindRemark} or di.remark like #{bindRemark}) and (dh.remark like #{bindRemark} or di.remark like #{bindRemark})
</if> </if>
and ifnull(dh.delete_flag,'0') !='1' and ifnull(dh.delete_flag,'0') !='1'
ORDER BY oper_time DESC,number desc
</select> </select>
<select id="getStatementAccount" resultType="com.jsh.erp.datasource.vo.DepotHeadVo4StatementAccount"> <select id="getStatementAccount" resultType="com.jsh.erp.datasource.vo.DepotHeadVo4StatementAccount">