优化收款单

This commit is contained in:
季圣华
2021-06-30 00:53:56 +08:00
parent dc2ba7237c
commit 4e66aeb98b
23 changed files with 693 additions and 37 deletions

View File

@@ -1090,7 +1090,7 @@ INSERT INTO `jsh_platform_config` (`id`, `platform_key`, `platform_key_info`, `p
-- by jishenghua -- by jishenghua
-- 将库存状态报表改为进销存统计报表 -- 将库存状态报表改为进销存统计报表
-- -------------------------------------------------------- -- --------------------------------------------------------
update jsh_function set name='进销存统计', sort='0658' where id=59 update jsh_function set name='进销存统计', sort='0658' where id=59;
-- -------------------------------------------------------- -- --------------------------------------------------------
-- 时间 2021年6月20日 -- 时间 2021年6月20日
@@ -1102,6 +1102,12 @@ INSERT INTO `jsh_function` (`number`, `name`, `parent_number`, `url`, `component
-- -------------------------------------------------------- -- --------------------------------------------------------
-- 时间 2021年6月29日 -- 时间 2021年6月29日
-- by jishenghua -- by jishenghua
-- 给功能表增加组件字段component -- 给财务子表增加字段bill_id
-- 给财务主表增加附件字段file_name
-- 给财务主表增加附件字段file_name
-- -------------------------------------------------------- -- --------------------------------------------------------
alter table jsh_account_item add bill_id bigint(20) DEFAULT NULL COMMENT '单据id' after in_out_item_id; alter table jsh_account_item add bill_id bigint(20) DEFAULT NULL COMMENT '进销存单据id' after in_out_item_id;
alter table jsh_account_item add need_debt decimal(24,6) DEFAULT NULL COMMENT '应收欠款' after bill_id;
alter table jsh_account_item add finish_debt decimal(24,6) DEFAULT NULL COMMENT '已收欠款' after need_debt;
alter table jsh_depot_head add file_name varchar(500) DEFAULT NULL COMMENT '附件名称' after remark;
alter table jsh_account_head add file_name varchar(500) DEFAULT NULL COMMENT '附件名称' after remark;

View File

@@ -52,6 +52,8 @@ public class AccountItemController {
item.put("inOutItemId", ai.getInOutItemId()); item.put("inOutItemId", ai.getInOutItemId());
item.put("inOutItemName", ai.getInOutItemName()); item.put("inOutItemName", ai.getInOutItemName());
item.put("billNumber", ai.getBillNumber()); item.put("billNumber", ai.getBillNumber());
item.put("needDebt", ai.getNeedDebt());
item.put("finishDebt", ai.getFinishDebt());
BigDecimal eachAmount = ai.getEachAmount(); BigDecimal eachAmount = ai.getEachAmount();
item.put("eachAmount", (eachAmount.compareTo(BigDecimal.ZERO))==-1 ? BigDecimal.ZERO.subtract(eachAmount): eachAmount); item.put("eachAmount", (eachAmount.compareTo(BigDecimal.ZERO))==-1 ? BigDecimal.ZERO.subtract(eachAmount): eachAmount);
item.put("remark", ai.getRemark()); item.put("remark", ai.getRemark());

View File

@@ -14,10 +14,7 @@ import com.jsh.erp.exception.BusinessParamCheckingException;
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.log.LogService;
import com.jsh.erp.service.redis.RedisService; import com.jsh.erp.service.redis.RedisService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.*;
import com.jsh.erp.utils.ErpInfo;
import com.jsh.erp.utils.StringUtil;
import com.jsh.erp.utils.Tools;
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.beans.factory.annotation.Value;
@@ -425,4 +422,35 @@ public class DepotHeadController {
} }
return res; return res;
} }
/**
* 查询存在欠款的单据
* @param search
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/debtList")
public String debtList(@RequestParam(value = Constants.SEARCH, required = false) String search,
HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
String organIdStr = StringUtil.getInfo(search, "organId");
Long organId = Long.parseLong(organIdStr);
String materialParam = StringUtil.getInfo(search, "materialParam");
String number = StringUtil.getInfo(search, "number");
String beginTime = StringUtil.getInfo(search, "beginTime");
String endTime = StringUtil.getInfo(search, "endTime");
String type = StringUtil.getInfo(search, "type");
String subType = StringUtil.getInfo(search, "subType");
String roleType = StringUtil.getInfo(search, "roleType");
String status = StringUtil.getInfo(search, "status");
List<DepotHeadVo4List> list = depotHeadService.debtList(organId, materialParam, number, beginTime, endTime, type, subType, roleType, status);
if (list != null) {
objectMap.put("rows", list);
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
objectMap.put("rows", new ArrayList<>());
return returnJson(objectMap, "查找不到数据", ErpInfo.OK.code);
}
}
} }

View File

@@ -11,14 +11,22 @@ import com.jsh.erp.service.systemConfig.SystemConfigService;
import com.jsh.erp.service.user.UserService; import com.jsh.erp.service.user.UserService;
import com.jsh.erp.service.userBusiness.UserBusinessService; import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.FileUtils;
import com.jsh.erp.utils.StringUtil; import com.jsh.erp.utils.StringUtil;
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.dao.DataAccessException; import org.springframework.dao.DataAccessException;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.List; import java.util.List;
/** /**
@@ -43,6 +51,9 @@ public class SystemConfigController {
@Resource @Resource
private SystemConfigService systemConfigService; private SystemConfigService systemConfigService;
@Value(value="${file.path}")
private String filePath;
@GetMapping(value = "/getDictItems/{dictCode}") @GetMapping(value = "/getDictItems/{dictCode}")
public BaseResponseInfo getDictItems(@PathVariable String dictCode, public BaseResponseInfo getDictItems(@PathVariable String dictCode,
HttpServletRequest request) { HttpServletRequest request) {
@@ -107,4 +118,78 @@ public class SystemConfigController {
} }
return res; return res;
} }
/**
* 文件上传统一方法
* @param request
* @param response
* @return
*/
@PostMapping(value = "/upload")
public BaseResponseInfo upload(HttpServletRequest request, HttpServletResponse response) {
BaseResponseInfo res = new BaseResponseInfo();
try {
String savePath = "";
String bizPath = request.getParameter("biz");
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
MultipartFile file = multipartRequest.getFile("file");// 获取上传文件对象
if(StringUtil.isEmpty(bizPath)){
bizPath = "";
}
savePath = this.uploadLocal(file,bizPath);
if(StringUtil.isNotEmpty(savePath)){
res.code = 200;
res.data = savePath;
}else {
res.code = 500;
res.data = "上传失败!";
}
} catch (Exception e) {
e.printStackTrace();
res.code = 500;
res.data = "上传失败!";
}
return res;
}
/**
* 本地文件上传
* @param mf 文件
* @param bizPath 自定义路径
* @return
*/
private String uploadLocal(MultipartFile mf,String bizPath){
try {
String ctxPath = filePath;
String fileName = null;
File file = new File(ctxPath + File.separator + bizPath + File.separator );
if (!file.exists()) {
file.mkdirs();// 创建文件根目录
}
String orgName = mf.getOriginalFilename();// 获取文件名
orgName = FileUtils.getFileName(orgName);
if(orgName.indexOf(".")!=-1){
fileName = orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.indexOf("."));
}else{
fileName = orgName+ "_" + System.currentTimeMillis();
}
String savePath = file.getPath() + File.separator + fileName;
File savefile = new File(savePath);
FileCopyUtils.copy(mf.getBytes(), savefile);
String dbpath = null;
if(StringUtil.isNotEmpty(bizPath)){
dbpath = bizPath + File.separator + fileName;
}else{
dbpath = fileName;
}
if (dbpath.contains("\\")) {
dbpath = dbpath.replace("\\", "/");
}
return dbpath;
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
return "";
}
} }

View File

@@ -26,6 +26,8 @@ public class AccountHead {
private String remark; private String remark;
private String fileName;
private Long tenantId; private Long tenantId;
private String deleteFlag; private String deleteFlag;
@@ -118,6 +120,14 @@ public class AccountHead {
this.remark = remark == null ? null : remark.trim(); this.remark = remark == null ? null : remark.trim();
} }
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName == null ? null : fileName.trim();
}
public Long getTenantId() { public Long getTenantId() {
return tenantId; return tenantId;
} }

View File

@@ -796,6 +796,76 @@ public class AccountHeadExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFileNameIsNull() {
addCriterion("file_name is null");
return (Criteria) this;
}
public Criteria andFileNameIsNotNull() {
addCriterion("file_name is not null");
return (Criteria) this;
}
public Criteria andFileNameEqualTo(String value) {
addCriterion("file_name =", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameNotEqualTo(String value) {
addCriterion("file_name <>", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameGreaterThan(String value) {
addCriterion("file_name >", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameGreaterThanOrEqualTo(String value) {
addCriterion("file_name >=", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameLessThan(String value) {
addCriterion("file_name <", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameLessThanOrEqualTo(String value) {
addCriterion("file_name <=", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameLike(String value) {
addCriterion("file_name like", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameNotLike(String value) {
addCriterion("file_name not like", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameIn(List<String> values) {
addCriterion("file_name in", values, "fileName");
return (Criteria) this;
}
public Criteria andFileNameNotIn(List<String> values) {
addCriterion("file_name not in", values, "fileName");
return (Criteria) this;
}
public Criteria andFileNameBetween(String value1, String value2) {
addCriterion("file_name between", value1, value2, "fileName");
return (Criteria) this;
}
public Criteria andFileNameNotBetween(String value1, String value2) {
addCriterion("file_name not between", value1, value2, "fileName");
return (Criteria) this;
}
public Criteria andTenantIdIsNull() { public Criteria andTenantIdIsNull() {
addCriterion("tenant_id is null"); addCriterion("tenant_id is null");
return (Criteria) this; return (Criteria) this;

View File

@@ -25,6 +25,8 @@ public class AccountHeadVo4ListEx {
private String remark; private String remark;
private String fileName;
private Long tenantId; private Long tenantId;
private String deleteFlag; private String deleteFlag;
@@ -121,6 +123,14 @@ public class AccountHeadVo4ListEx {
this.remark = remark; this.remark = remark;
} }
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public Long getTenantId() { public Long getTenantId() {
return tenantId; return tenantId;
} }

View File

@@ -13,6 +13,10 @@ public class AccountItem {
private Long billId; private Long billId;
private BigDecimal needDebt;
private BigDecimal finishDebt;
private BigDecimal eachAmount; private BigDecimal eachAmount;
private String remark; private String remark;
@@ -61,6 +65,22 @@ public class AccountItem {
this.billId = billId; this.billId = billId;
} }
public BigDecimal getNeedDebt() {
return needDebt;
}
public void setNeedDebt(BigDecimal needDebt) {
this.needDebt = needDebt;
}
public BigDecimal getFinishDebt() {
return finishDebt;
}
public void setFinishDebt(BigDecimal finishDebt) {
this.finishDebt = finishDebt;
}
public BigDecimal getEachAmount() { public BigDecimal getEachAmount() {
return eachAmount; return eachAmount;
} }

View File

@@ -405,6 +405,126 @@ public class AccountItemExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNeedDebtIsNull() {
addCriterion("need_debt is null");
return (Criteria) this;
}
public Criteria andNeedDebtIsNotNull() {
addCriterion("need_debt is not null");
return (Criteria) this;
}
public Criteria andNeedDebtEqualTo(BigDecimal value) {
addCriterion("need_debt =", value, "needDebt");
return (Criteria) this;
}
public Criteria andNeedDebtNotEqualTo(BigDecimal value) {
addCriterion("need_debt <>", value, "needDebt");
return (Criteria) this;
}
public Criteria andNeedDebtGreaterThan(BigDecimal value) {
addCriterion("need_debt >", value, "needDebt");
return (Criteria) this;
}
public Criteria andNeedDebtGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("need_debt >=", value, "needDebt");
return (Criteria) this;
}
public Criteria andNeedDebtLessThan(BigDecimal value) {
addCriterion("need_debt <", value, "needDebt");
return (Criteria) this;
}
public Criteria andNeedDebtLessThanOrEqualTo(BigDecimal value) {
addCriterion("need_debt <=", value, "needDebt");
return (Criteria) this;
}
public Criteria andNeedDebtIn(List<BigDecimal> values) {
addCriterion("need_debt in", values, "needDebt");
return (Criteria) this;
}
public Criteria andNeedDebtNotIn(List<BigDecimal> values) {
addCriterion("need_debt not in", values, "needDebt");
return (Criteria) this;
}
public Criteria andNeedDebtBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("need_debt between", value1, value2, "needDebt");
return (Criteria) this;
}
public Criteria andNeedDebtNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("need_debt not between", value1, value2, "needDebt");
return (Criteria) this;
}
public Criteria andFinishDebtIsNull() {
addCriterion("finish_debt is null");
return (Criteria) this;
}
public Criteria andFinishDebtIsNotNull() {
addCriterion("finish_debt is not null");
return (Criteria) this;
}
public Criteria andFinishDebtEqualTo(BigDecimal value) {
addCriterion("finish_debt =", value, "finishDebt");
return (Criteria) this;
}
public Criteria andFinishDebtNotEqualTo(BigDecimal value) {
addCriterion("finish_debt <>", value, "finishDebt");
return (Criteria) this;
}
public Criteria andFinishDebtGreaterThan(BigDecimal value) {
addCriterion("finish_debt >", value, "finishDebt");
return (Criteria) this;
}
public Criteria andFinishDebtGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("finish_debt >=", value, "finishDebt");
return (Criteria) this;
}
public Criteria andFinishDebtLessThan(BigDecimal value) {
addCriterion("finish_debt <", value, "finishDebt");
return (Criteria) this;
}
public Criteria andFinishDebtLessThanOrEqualTo(BigDecimal value) {
addCriterion("finish_debt <=", value, "finishDebt");
return (Criteria) this;
}
public Criteria andFinishDebtIn(List<BigDecimal> values) {
addCriterion("finish_debt in", values, "finishDebt");
return (Criteria) this;
}
public Criteria andFinishDebtNotIn(List<BigDecimal> values) {
addCriterion("finish_debt not in", values, "finishDebt");
return (Criteria) this;
}
public Criteria andFinishDebtBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("finish_debt between", value1, value2, "finishDebt");
return (Criteria) this;
}
public Criteria andFinishDebtNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("finish_debt not between", value1, value2, "finishDebt");
return (Criteria) this;
}
public Criteria andEachAmountIsNull() { public Criteria andEachAmountIsNull() {
addCriterion("each_amount is null"); addCriterion("each_amount is null");
return (Criteria) this; return (Criteria) this;

View File

@@ -36,6 +36,8 @@ public class DepotHead {
private String remark; private String remark;
private String fileName;
private String salesMan; private String salesMan;
private String accountIdList; private String accountIdList;
@@ -192,6 +194,14 @@ public class DepotHead {
this.remark = remark == null ? null : remark.trim(); this.remark = remark == null ? null : remark.trim();
} }
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName == null ? null : fileName.trim();
}
public String getSalesMan() { public String getSalesMan() {
return salesMan; return salesMan;
} }

View File

@@ -1136,6 +1136,76 @@ public class DepotHeadExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFileNameIsNull() {
addCriterion("file_name is null");
return (Criteria) this;
}
public Criteria andFileNameIsNotNull() {
addCriterion("file_name is not null");
return (Criteria) this;
}
public Criteria andFileNameEqualTo(String value) {
addCriterion("file_name =", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameNotEqualTo(String value) {
addCriterion("file_name <>", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameGreaterThan(String value) {
addCriterion("file_name >", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameGreaterThanOrEqualTo(String value) {
addCriterion("file_name >=", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameLessThan(String value) {
addCriterion("file_name <", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameLessThanOrEqualTo(String value) {
addCriterion("file_name <=", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameLike(String value) {
addCriterion("file_name like", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameNotLike(String value) {
addCriterion("file_name not like", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameIn(List<String> values) {
addCriterion("file_name in", values, "fileName");
return (Criteria) this;
}
public Criteria andFileNameNotIn(List<String> values) {
addCriterion("file_name not in", values, "fileName");
return (Criteria) this;
}
public Criteria andFileNameBetween(String value1, String value2) {
addCriterion("file_name between", value1, value2, "fileName");
return (Criteria) this;
}
public Criteria andFileNameNotBetween(String value1, String value2) {
addCriterion("file_name not between", value1, value2, "fileName");
return (Criteria) this;
}
public Criteria andSalesManIsNull() { public Criteria andSalesManIsNull() {
addCriterion("sales_man is null"); addCriterion("sales_man is null");
return (Criteria) this; return (Criteria) this;

View File

@@ -5,6 +5,7 @@ import com.jsh.erp.datasource.entities.AccountItemExample;
import com.jsh.erp.datasource.vo.AccountItemVo4List; import com.jsh.erp.datasource.vo.AccountItemVo4List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@@ -34,4 +35,6 @@ public interface AccountItemMapperEx {
List<AccountItem> getAccountItemListByInOutItemIds(@Param("inOutItemIds") String[] inOutItemIds); List<AccountItem> getAccountItemListByInOutItemIds(@Param("inOutItemIds") String[] inOutItemIds);
int batchDeleteAccountItemByHeadIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String[] ids); int batchDeleteAccountItemByHeadIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String[] ids);
BigDecimal getEachAmountByBillId(@Param("billId") Long billId);
} }

View File

@@ -132,4 +132,16 @@ public interface DepotHeadMapperEx {
@Param("hasSupplier") Integer hasSupplier, @Param("hasSupplier") Integer hasSupplier,
@Param("beginTime") String beginTime, @Param("beginTime") String beginTime,
@Param("endTime") String endTime); @Param("endTime") String endTime);
List<DepotHeadVo4List> debtList(
@Param("organId") Long organId,
@Param("type") String type,
@Param("subType") String subType,
@Param("creatorArray") String[] creatorArray,
@Param("status") String status,
@Param("number") String number,
@Param("beginTime") String beginTime,
@Param("endTime") String endTime,
@Param("materialParam") String materialParam,
@Param("depotArray") String[] depotArray);
} }

View File

@@ -23,6 +23,8 @@ public class DepotHeadVo4List extends DepotHead{
private String operTimeStr; private String operTimeStr;
private BigDecimal finishDebt;
public String getProjectName() { public String getProjectName() {
return projectName; return projectName;
} }
@@ -86,4 +88,12 @@ public class DepotHeadVo4List extends DepotHead{
public void setOperTimeStr(String operTimeStr) { public void setOperTimeStr(String operTimeStr) {
this.operTimeStr = operTimeStr; this.operTimeStr = operTimeStr;
} }
public BigDecimal getFinishDebt() {
return finishDebt;
}
public void setFinishDebt(BigDecimal finishDebt) {
this.finishDebt = finishDebt;
}
} }

View File

@@ -205,6 +205,12 @@ public class AccountItemService {
String billNo = tempInsertedJson.getString("billNumber"); String billNo = tempInsertedJson.getString("billNumber");
accountItem.setBillId(depotHeadService.getDepotHead(billNo).getId()); accountItem.setBillId(depotHeadService.getDepotHead(billNo).getId());
} }
if (tempInsertedJson.get("needDebt") != null && !tempInsertedJson.get("needDebt").equals("")) {
accountItem.setNeedDebt(tempInsertedJson.getBigDecimal("needDebt"));
}
if (tempInsertedJson.get("finishDebt") != null && !tempInsertedJson.get("finishDebt").equals("")) {
accountItem.setFinishDebt(tempInsertedJson.getBigDecimal("finishDebt"));
}
if (tempInsertedJson.get("eachAmount") != null && !tempInsertedJson.get("eachAmount").equals("")) { if (tempInsertedJson.get("eachAmount") != null && !tempInsertedJson.get("eachAmount").equals("")) {
BigDecimal eachAmount = tempInsertedJson.getBigDecimal("eachAmount"); BigDecimal eachAmount = tempInsertedJson.getBigDecimal("eachAmount");
if (type.equals("付款")) { if (type.equals("付款")) {
@@ -249,4 +255,8 @@ public class AccountItemService {
} }
return result; return result;
} }
public BigDecimal getEachAmountByBillId(Long billId) {
return accountItemMapperEx.getEachAmountByBillId(billId);
}
} }

View File

@@ -3,7 +3,10 @@ package com.jsh.erp.service.depotHead;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants; import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.constants.ExceptionConstants; import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.*; import com.jsh.erp.datasource.entities.DepotHead;
import com.jsh.erp.datasource.entities.DepotHeadExample;
import com.jsh.erp.datasource.entities.DepotItem;
import com.jsh.erp.datasource.entities.User;
import com.jsh.erp.datasource.mappers.DepotHeadMapper; import com.jsh.erp.datasource.mappers.DepotHeadMapper;
import com.jsh.erp.datasource.mappers.DepotHeadMapperEx; import com.jsh.erp.datasource.mappers.DepotHeadMapperEx;
import com.jsh.erp.datasource.mappers.DepotItemMapperEx; import com.jsh.erp.datasource.mappers.DepotItemMapperEx;
@@ -14,6 +17,7 @@ import com.jsh.erp.datasource.vo.DepotHeadVo4StatementAccount;
import com.jsh.erp.exception.BusinessRunTimeException; import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.exception.JshException; import com.jsh.erp.exception.JshException;
import com.jsh.erp.service.account.AccountService; import com.jsh.erp.service.account.AccountService;
import com.jsh.erp.service.accountItem.AccountItemService;
import com.jsh.erp.service.depot.DepotService; import com.jsh.erp.service.depot.DepotService;
import com.jsh.erp.service.depotItem.DepotItemService; import com.jsh.erp.service.depotItem.DepotItemService;
import com.jsh.erp.service.log.LogService; import com.jsh.erp.service.log.LogService;
@@ -36,7 +40,10 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.*; import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import static com.jsh.erp.utils.Tools.getCenternTime; import static com.jsh.erp.utils.Tools.getCenternTime;
@@ -65,6 +72,8 @@ public class DepotHeadService {
@Resource @Resource
private AccountService accountService; private AccountService accountService;
@Resource @Resource
private AccountItemService accountItemService;
@Resource
DepotItemMapperEx depotItemMapperEx; DepotItemMapperEx depotItemMapperEx;
@Resource @Resource
private LogService logService; private LogService logService;
@@ -685,4 +694,36 @@ public class DepotHeadService {
} }
return depotHead; return depotHead;
} }
public List<DepotHeadVo4List> debtList(Long organId, String materialParam, String number, String beginTime, String endTime,
String type, String subType, String roleType, String status) {
List<DepotHeadVo4List> resList = new ArrayList<>();
try{
String depotIds = depotService.findDepotStrByCurrentUser();
String [] depotArray=depotIds.split(",");
String [] creatorArray = getCreatorArray(roleType);
beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME);
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
List<DepotHeadVo4List> list=depotHeadMapperEx.debtList(organId, type, subType, creatorArray, status, number, beginTime, endTime, materialParam, depotArray);
if (null != list) {
for (DepotHeadVo4List dh : list) {
if(dh.getChangeAmount() != null) {
dh.setChangeAmount(dh.getChangeAmount().abs());
}
if(dh.getTotalPrice() != null) {
dh.setTotalPrice(dh.getTotalPrice().abs());
}
if(dh.getOperTime() != null) {
dh.setOperTimeStr(getCenternTime(dh.getOperTime()));
}
dh.setFinishDebt(accountItemService.getEachAmountByBillId(dh.getId()));
dh.setMaterialsList(findMaterialsListByHeaderId(dh.getId()));
resList.add(dh);
}
}
}catch(Exception e){
JshException.readFail(logger, e);
}
return resList;
}
} }

View File

@@ -330,4 +330,26 @@ public class FileUtils {
} }
} }
/**
* 判断文件名是否带盘符,重新处理
* @param fileName
* @return
*/
public static String getFileName(String fileName){
//判断是否带有盘符信息
// Check for Unix-style path
int unixSep = fileName.lastIndexOf('/');
// Check for Windows-style path
int winSep = fileName.lastIndexOf('\\');
// Cut off at latest possible point
int pos = (winSep > unixSep ? winSep : unixSep);
if (pos != -1) {
// Any sort of path separator found...
fileName = fileName.substring(pos + 1);
}
//替换上传文件名字的特殊字符
fileName = fileName.replace("=","").replace(",","").replace("&","");
return fileName;
}
} }

View File

@@ -25,4 +25,6 @@ demonstrate.open=false
#插件配置 #插件配置
plugin.runMode=prod plugin.runMode=prod
plugin.pluginPath=plugins plugin.pluginPath=plugins
plugin.pluginConfigFilePath=pluginConfig plugin.pluginConfigFilePath=pluginConfig
#文件上传根目录
file.path=/opt/jshERP/upload

View File

@@ -13,6 +13,7 @@
<result column="bill_no" jdbcType="VARCHAR" property="billNo" /> <result column="bill_no" jdbcType="VARCHAR" property="billNo" />
<result column="bill_time" jdbcType="TIMESTAMP" property="billTime" /> <result column="bill_time" jdbcType="TIMESTAMP" property="billTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" /> <result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="file_name" jdbcType="VARCHAR" property="fileName" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" /> <result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="delete_flag" jdbcType="VARCHAR" property="deleteFlag" /> <result column="delete_flag" jdbcType="VARCHAR" property="deleteFlag" />
</resultMap> </resultMap>
@@ -76,7 +77,7 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, type, organ_id, hands_person_id, creator, change_amount, total_price, account_id, id, type, organ_id, hands_person_id, creator, change_amount, total_price, account_id,
bill_no, bill_time, remark, tenant_id, delete_flag bill_no, bill_time, remark, file_name, tenant_id, delete_flag
</sql> </sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.AccountHeadExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.AccountHeadExample" resultMap="BaseResultMap">
select select
@@ -112,13 +113,13 @@
insert into jsh_account_head (id, type, organ_id, insert into jsh_account_head (id, type, organ_id,
hands_person_id, creator, change_amount, hands_person_id, creator, change_amount,
total_price, account_id, bill_no, total_price, account_id, bill_no,
bill_time, remark, tenant_id, bill_time, remark, file_name,
delete_flag) tenant_id, delete_flag)
values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{organId,jdbcType=BIGINT}, values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{organId,jdbcType=BIGINT},
#{handsPersonId,jdbcType=BIGINT}, #{creator,jdbcType=BIGINT}, #{changeAmount,jdbcType=DECIMAL}, #{handsPersonId,jdbcType=BIGINT}, #{creator,jdbcType=BIGINT}, #{changeAmount,jdbcType=DECIMAL},
#{totalPrice,jdbcType=DECIMAL}, #{accountId,jdbcType=BIGINT}, #{billNo,jdbcType=VARCHAR}, #{totalPrice,jdbcType=DECIMAL}, #{accountId,jdbcType=BIGINT}, #{billNo,jdbcType=VARCHAR},
#{billTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{billTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR},
#{deleteFlag,jdbcType=VARCHAR}) #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.AccountHead"> <insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.AccountHead">
insert into jsh_account_head insert into jsh_account_head
@@ -156,6 +157,9 @@
<if test="remark != null"> <if test="remark != null">
remark, remark,
</if> </if>
<if test="fileName != null">
file_name,
</if>
<if test="tenantId != null"> <if test="tenantId != null">
tenant_id, tenant_id,
</if> </if>
@@ -197,6 +201,9 @@
<if test="remark != null"> <if test="remark != null">
#{remark,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
</if> </if>
<if test="fileName != null">
#{fileName,jdbcType=VARCHAR},
</if>
<if test="tenantId != null"> <if test="tenantId != null">
#{tenantId,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT},
</if> </if>
@@ -247,6 +254,9 @@
<if test="record.remark != null"> <if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR}, remark = #{record.remark,jdbcType=VARCHAR},
</if> </if>
<if test="record.fileName != null">
file_name = #{record.fileName,jdbcType=VARCHAR},
</if>
<if test="record.tenantId != null"> <if test="record.tenantId != null">
tenant_id = #{record.tenantId,jdbcType=BIGINT}, tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if> </if>
@@ -271,6 +281,7 @@
bill_no = #{record.billNo,jdbcType=VARCHAR}, bill_no = #{record.billNo,jdbcType=VARCHAR},
bill_time = #{record.billTime,jdbcType=TIMESTAMP}, bill_time = #{record.billTime,jdbcType=TIMESTAMP},
remark = #{record.remark,jdbcType=VARCHAR}, remark = #{record.remark,jdbcType=VARCHAR},
file_name = #{record.fileName,jdbcType=VARCHAR},
tenant_id = #{record.tenantId,jdbcType=BIGINT}, tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
@@ -310,6 +321,9 @@
<if test="remark != null"> <if test="remark != null">
remark = #{remark,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
</if> </if>
<if test="fileName != null">
file_name = #{fileName,jdbcType=VARCHAR},
</if>
<if test="tenantId != null"> <if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=BIGINT}, tenant_id = #{tenantId,jdbcType=BIGINT},
</if> </if>
@@ -331,6 +345,7 @@
bill_no = #{billNo,jdbcType=VARCHAR}, bill_no = #{billNo,jdbcType=VARCHAR},
bill_time = #{billTime,jdbcType=TIMESTAMP}, bill_time = #{billTime,jdbcType=TIMESTAMP},
remark = #{remark,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
file_name = #{fileName,jdbcType=VARCHAR},
tenant_id = #{tenantId,jdbcType=BIGINT}, tenant_id = #{tenantId,jdbcType=BIGINT},
delete_flag = #{deleteFlag,jdbcType=VARCHAR} delete_flag = #{deleteFlag,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}

View File

@@ -7,6 +7,8 @@
<result column="account_id" jdbcType="BIGINT" property="accountId" /> <result column="account_id" jdbcType="BIGINT" property="accountId" />
<result column="in_out_item_id" jdbcType="BIGINT" property="inOutItemId" /> <result column="in_out_item_id" jdbcType="BIGINT" property="inOutItemId" />
<result column="bill_id" jdbcType="BIGINT" property="billId" /> <result column="bill_id" jdbcType="BIGINT" property="billId" />
<result column="need_debt" jdbcType="DECIMAL" property="needDebt" />
<result column="finish_debt" jdbcType="DECIMAL" property="finishDebt" />
<result column="each_amount" jdbcType="DECIMAL" property="eachAmount" /> <result column="each_amount" jdbcType="DECIMAL" property="eachAmount" />
<result column="remark" jdbcType="VARCHAR" property="remark" /> <result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" /> <result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
@@ -71,8 +73,8 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, header_id, account_id, in_out_item_id, bill_id, each_amount, remark, tenant_id, id, header_id, account_id, in_out_item_id, bill_id, need_debt, finish_debt, each_amount,
delete_flag remark, tenant_id, delete_flag
</sql> </sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.AccountItemExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.AccountItemExample" resultMap="BaseResultMap">
select select
@@ -106,13 +108,13 @@
</delete> </delete>
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.AccountItem"> <insert id="insert" parameterType="com.jsh.erp.datasource.entities.AccountItem">
insert into jsh_account_item (id, header_id, account_id, insert into jsh_account_item (id, header_id, account_id,
in_out_item_id, bill_id, each_amount, in_out_item_id, bill_id, need_debt,
remark, tenant_id, delete_flag finish_debt, each_amount, remark,
) tenant_id, delete_flag)
values (#{id,jdbcType=BIGINT}, #{headerId,jdbcType=BIGINT}, #{accountId,jdbcType=BIGINT}, values (#{id,jdbcType=BIGINT}, #{headerId,jdbcType=BIGINT}, #{accountId,jdbcType=BIGINT},
#{inOutItemId,jdbcType=BIGINT}, #{billId,jdbcType=BIGINT}, #{eachAmount,jdbcType=DECIMAL}, #{inOutItemId,jdbcType=BIGINT}, #{billId,jdbcType=BIGINT}, #{needDebt,jdbcType=DECIMAL},
#{remark,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR} #{finishDebt,jdbcType=DECIMAL}, #{eachAmount,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR},
) #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.AccountItem"> <insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.AccountItem">
insert into jsh_account_item insert into jsh_account_item
@@ -132,6 +134,12 @@
<if test="billId != null"> <if test="billId != null">
bill_id, bill_id,
</if> </if>
<if test="needDebt != null">
need_debt,
</if>
<if test="finishDebt != null">
finish_debt,
</if>
<if test="eachAmount != null"> <if test="eachAmount != null">
each_amount, each_amount,
</if> </if>
@@ -161,6 +169,12 @@
<if test="billId != null"> <if test="billId != null">
#{billId,jdbcType=BIGINT}, #{billId,jdbcType=BIGINT},
</if> </if>
<if test="needDebt != null">
#{needDebt,jdbcType=DECIMAL},
</if>
<if test="finishDebt != null">
#{finishDebt,jdbcType=DECIMAL},
</if>
<if test="eachAmount != null"> <if test="eachAmount != null">
#{eachAmount,jdbcType=DECIMAL}, #{eachAmount,jdbcType=DECIMAL},
</if> </if>
@@ -199,6 +213,12 @@
<if test="record.billId != null"> <if test="record.billId != null">
bill_id = #{record.billId,jdbcType=BIGINT}, bill_id = #{record.billId,jdbcType=BIGINT},
</if> </if>
<if test="record.needDebt != null">
need_debt = #{record.needDebt,jdbcType=DECIMAL},
</if>
<if test="record.finishDebt != null">
finish_debt = #{record.finishDebt,jdbcType=DECIMAL},
</if>
<if test="record.eachAmount != null"> <if test="record.eachAmount != null">
each_amount = #{record.eachAmount,jdbcType=DECIMAL}, each_amount = #{record.eachAmount,jdbcType=DECIMAL},
</if> </if>
@@ -223,6 +243,8 @@
account_id = #{record.accountId,jdbcType=BIGINT}, account_id = #{record.accountId,jdbcType=BIGINT},
in_out_item_id = #{record.inOutItemId,jdbcType=BIGINT}, in_out_item_id = #{record.inOutItemId,jdbcType=BIGINT},
bill_id = #{record.billId,jdbcType=BIGINT}, bill_id = #{record.billId,jdbcType=BIGINT},
need_debt = #{record.needDebt,jdbcType=DECIMAL},
finish_debt = #{record.finishDebt,jdbcType=DECIMAL},
each_amount = #{record.eachAmount,jdbcType=DECIMAL}, each_amount = #{record.eachAmount,jdbcType=DECIMAL},
remark = #{record.remark,jdbcType=VARCHAR}, remark = #{record.remark,jdbcType=VARCHAR},
tenant_id = #{record.tenantId,jdbcType=BIGINT}, tenant_id = #{record.tenantId,jdbcType=BIGINT},
@@ -246,6 +268,12 @@
<if test="billId != null"> <if test="billId != null">
bill_id = #{billId,jdbcType=BIGINT}, bill_id = #{billId,jdbcType=BIGINT},
</if> </if>
<if test="needDebt != null">
need_debt = #{needDebt,jdbcType=DECIMAL},
</if>
<if test="finishDebt != null">
finish_debt = #{finishDebt,jdbcType=DECIMAL},
</if>
<if test="eachAmount != null"> <if test="eachAmount != null">
each_amount = #{eachAmount,jdbcType=DECIMAL}, each_amount = #{eachAmount,jdbcType=DECIMAL},
</if> </if>
@@ -267,6 +295,8 @@
account_id = #{accountId,jdbcType=BIGINT}, account_id = #{accountId,jdbcType=BIGINT},
in_out_item_id = #{inOutItemId,jdbcType=BIGINT}, in_out_item_id = #{inOutItemId,jdbcType=BIGINT},
bill_id = #{billId,jdbcType=BIGINT}, bill_id = #{billId,jdbcType=BIGINT},
need_debt = #{needDebt,jdbcType=DECIMAL},
finish_debt = #{finishDebt,jdbcType=DECIMAL},
each_amount = #{eachAmount,jdbcType=DECIMAL}, each_amount = #{eachAmount,jdbcType=DECIMAL},
remark = #{remark,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
tenant_id = #{tenantId,jdbcType=BIGINT}, tenant_id = #{tenantId,jdbcType=BIGINT},

View File

@@ -102,6 +102,7 @@
) )
and ifnull(delete_flag,'0') !='1' and ifnull(delete_flag,'0') !='1'
</select> </select>
<update id="batchDeleteAccountItemByHeadIds"> <update id="batchDeleteAccountItemByHeadIds">
update jsh_account_item update jsh_account_item
set delete_flag='1' set delete_flag='1'
@@ -112,4 +113,15 @@
</foreach> </foreach>
) )
</update> </update>
<select id="getEachAmountByBillId" resultType="java.math.BigDecimal">
select
ifnull(sum(each_amount),0)
from jsh_account_item
where 1=1
<if test="billId != null">
and bill_id=#{billId}
</if>
and ifnull(delete_flag,'0') !='1'
</select>
</mapper> </mapper>

View File

@@ -18,6 +18,7 @@
<result column="pay_type" jdbcType="VARCHAR" property="payType" /> <result column="pay_type" jdbcType="VARCHAR" property="payType" />
<result column="bill_type" jdbcType="VARCHAR" property="billType" /> <result column="bill_type" jdbcType="VARCHAR" property="billType" />
<result column="remark" jdbcType="VARCHAR" property="remark" /> <result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="file_name" jdbcType="VARCHAR" property="fileName" />
<result column="sales_man" jdbcType="VARCHAR" property="salesMan" /> <result column="sales_man" jdbcType="VARCHAR" property="salesMan" />
<result column="account_id_list" jdbcType="VARCHAR" property="accountIdList" /> <result column="account_id_list" jdbcType="VARCHAR" property="accountIdList" />
<result column="account_money_list" jdbcType="VARCHAR" property="accountMoneyList" /> <result column="account_money_list" jdbcType="VARCHAR" property="accountMoneyList" />
@@ -93,8 +94,8 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, type, sub_type, default_number, number, create_time, oper_time, organ_id, hands_person_id, id, type, sub_type, default_number, number, create_time, oper_time, organ_id, hands_person_id,
creator, account_id, change_amount, total_price, pay_type, bill_type, remark, sales_man, creator, account_id, change_amount, total_price, pay_type, bill_type, remark, file_name,
account_id_list, account_money_list, discount, discount_money, discount_last_money, sales_man, account_id_list, account_money_list, discount, discount_money, discount_last_money,
other_money, other_money_list, other_money_item, account_day, status, link_number, other_money, other_money_list, other_money_item, account_day, status, link_number,
tenant_id, delete_flag tenant_id, delete_flag
</sql> </sql>
@@ -134,23 +135,23 @@
oper_time, organ_id, hands_person_id, oper_time, organ_id, hands_person_id,
creator, account_id, change_amount, creator, account_id, change_amount,
total_price, pay_type, bill_type, total_price, pay_type, bill_type,
remark, sales_man, account_id_list, remark, file_name, sales_man,
account_money_list, discount, discount_money, account_id_list, account_money_list, discount,
discount_last_money, other_money, other_money_list, discount_money, discount_last_money, other_money,
other_money_item, account_day, status, other_money_list, other_money_item, account_day,
link_number, tenant_id, delete_flag status, link_number, tenant_id,
) delete_flag)
values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{subType,jdbcType=VARCHAR}, values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{subType,jdbcType=VARCHAR},
#{defaultNumber,jdbcType=VARCHAR}, #{number,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{defaultNumber,jdbcType=VARCHAR}, #{number,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{operTime,jdbcType=TIMESTAMP}, #{organId,jdbcType=BIGINT}, #{handsPersonId,jdbcType=BIGINT}, #{operTime,jdbcType=TIMESTAMP}, #{organId,jdbcType=BIGINT}, #{handsPersonId,jdbcType=BIGINT},
#{creator,jdbcType=BIGINT}, #{accountId,jdbcType=BIGINT}, #{changeAmount,jdbcType=DECIMAL}, #{creator,jdbcType=BIGINT}, #{accountId,jdbcType=BIGINT}, #{changeAmount,jdbcType=DECIMAL},
#{totalPrice,jdbcType=DECIMAL}, #{payType,jdbcType=VARCHAR}, #{billType,jdbcType=VARCHAR}, #{totalPrice,jdbcType=DECIMAL}, #{payType,jdbcType=VARCHAR}, #{billType,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{salesMan,jdbcType=VARCHAR}, #{accountIdList,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR}, #{salesMan,jdbcType=VARCHAR},
#{accountMoneyList,jdbcType=VARCHAR}, #{discount,jdbcType=DECIMAL}, #{discountMoney,jdbcType=DECIMAL}, #{accountIdList,jdbcType=VARCHAR}, #{accountMoneyList,jdbcType=VARCHAR}, #{discount,jdbcType=DECIMAL},
#{discountLastMoney,jdbcType=DECIMAL}, #{otherMoney,jdbcType=DECIMAL}, #{otherMoneyList,jdbcType=VARCHAR}, #{discountMoney,jdbcType=DECIMAL}, #{discountLastMoney,jdbcType=DECIMAL}, #{otherMoney,jdbcType=DECIMAL},
#{otherMoneyItem,jdbcType=VARCHAR}, #{accountDay,jdbcType=INTEGER}, #{status,jdbcType=VARCHAR}, #{otherMoneyList,jdbcType=VARCHAR}, #{otherMoneyItem,jdbcType=VARCHAR}, #{accountDay,jdbcType=INTEGER},
#{linkNumber,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR} #{status,jdbcType=VARCHAR}, #{linkNumber,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT},
) #{deleteFlag,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.DepotHead"> <insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.DepotHead">
insert into jsh_depot_head insert into jsh_depot_head
@@ -203,6 +204,9 @@
<if test="remark != null"> <if test="remark != null">
remark, remark,
</if> </if>
<if test="fileName != null">
file_name,
</if>
<if test="salesMan != null"> <if test="salesMan != null">
sales_man, sales_man,
</if> </if>
@@ -295,6 +299,9 @@
<if test="remark != null"> <if test="remark != null">
#{remark,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
</if> </if>
<if test="fileName != null">
#{fileName,jdbcType=VARCHAR},
</if>
<if test="salesMan != null"> <if test="salesMan != null">
#{salesMan,jdbcType=VARCHAR}, #{salesMan,jdbcType=VARCHAR},
</if> </if>
@@ -396,6 +403,9 @@
<if test="record.remark != null"> <if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR}, remark = #{record.remark,jdbcType=VARCHAR},
</if> </if>
<if test="record.fileName != null">
file_name = #{record.fileName,jdbcType=VARCHAR},
</if>
<if test="record.salesMan != null"> <if test="record.salesMan != null">
sales_man = #{record.salesMan,jdbcType=VARCHAR}, sales_man = #{record.salesMan,jdbcType=VARCHAR},
</if> </if>
@@ -461,6 +471,7 @@
pay_type = #{record.payType,jdbcType=VARCHAR}, pay_type = #{record.payType,jdbcType=VARCHAR},
bill_type = #{record.billType,jdbcType=VARCHAR}, bill_type = #{record.billType,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR}, remark = #{record.remark,jdbcType=VARCHAR},
file_name = #{record.fileName,jdbcType=VARCHAR},
sales_man = #{record.salesMan,jdbcType=VARCHAR}, sales_man = #{record.salesMan,jdbcType=VARCHAR},
account_id_list = #{record.accountIdList,jdbcType=VARCHAR}, account_id_list = #{record.accountIdList,jdbcType=VARCHAR},
account_money_list = #{record.accountMoneyList,jdbcType=VARCHAR}, account_money_list = #{record.accountMoneyList,jdbcType=VARCHAR},
@@ -527,6 +538,9 @@
<if test="remark != null"> <if test="remark != null">
remark = #{remark,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
</if> </if>
<if test="fileName != null">
file_name = #{fileName,jdbcType=VARCHAR},
</if>
<if test="salesMan != null"> <if test="salesMan != null">
sales_man = #{salesMan,jdbcType=VARCHAR}, sales_man = #{salesMan,jdbcType=VARCHAR},
</if> </if>
@@ -589,6 +603,7 @@
pay_type = #{payType,jdbcType=VARCHAR}, pay_type = #{payType,jdbcType=VARCHAR},
bill_type = #{billType,jdbcType=VARCHAR}, bill_type = #{billType,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
file_name = #{fileName,jdbcType=VARCHAR},
sales_man = #{salesMan,jdbcType=VARCHAR}, sales_man = #{salesMan,jdbcType=VARCHAR},
account_id_list = #{accountIdList,jdbcType=VARCHAR}, account_id_list = #{accountIdList,jdbcType=VARCHAR},
account_money_list = #{accountMoneyList,jdbcType=VARCHAR}, account_money_list = #{accountMoneyList,jdbcType=VARCHAR},

View File

@@ -448,4 +448,57 @@
</if> </if>
and ifnull(delete_flag,'0') !='1' and ifnull(delete_flag,'0') !='1'
</select> </select>
<select id="debtList" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="ResultMapEx">
select distinct dh.*, s.supplier OrganName, u.username userName
from jsh_depot_head dh
left join jsh_supplier s on dh.organ_id=s.id and ifnull(s.delete_Flag,'0') !='1'
left join jsh_user u on dh.creator=u.id and ifnull(u.Status,'0') ='0'
left join jsh_depot_item di on dh.id = di.header_id and ifnull(di.delete_flag,'0') !='1'
left join jsh_material m on di.material_id = m.id and ifnull(m.delete_flag,'0') !='1'
where 1=1
<if test="organId != null">
and dh.organ_id = #{organId}
</if>
<if test="type != null">
and dh.type=#{type}
</if>
<if test="subType != null">
and dh.sub_type=#{subType}
</if>
<if test="status != null">
and dh.status =#{status}
</if>
<if test="number != null">
<bind name="bindNumber" value="'%'+number+'%'"/>
and dh.number like #{bindNumber}
</if>
<if test="beginTime != null">
and dh.oper_time >= #{beginTime}
</if>
<if test="endTime != null">
and dh.oper_time &lt;= #{endTime}
</if>
<if test="materialParam != null and materialParam !=''">
<bind name="bindKey" value="'%'+materialParam+'%'"/>
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
</if>
<if test="depotArray != null and depotArray !=''">
and di.depot_id in (
<foreach collection="depotArray" item="depotId" separator=",">
#{depotId}
</foreach>
)
</if>
<if test="creatorArray != null">
and dh.creator in (
<foreach collection="creatorArray" item="creator" separator=",">
#{creator}
</foreach>
)
</if>
and abs(dh.change_amount) &lt; dh.discount_last_money
and ifnull(dh.delete_flag,'0') !='1'
order by dh.id desc
</select>
</mapper> </mapper>