diff --git a/jshERP-boot/docs/jsh_erp.sql b/jshERP-boot/docs/jsh_erp.sql index ecfc7113..1139f8c3 100644 --- a/jshERP-boot/docs/jsh_erp.sql +++ b/jshERP-boot/docs/jsh_erp.sql @@ -81,6 +81,7 @@ CREATE TABLE `jsh_account_item` ( `header_id` bigint(20) NOT NULL COMMENT '表头Id', `account_id` bigint(20) DEFAULT NULL COMMENT '账户Id', `in_out_item_id` bigint(20) DEFAULT NULL COMMENT '收支项目Id', + `bill_id` bigint(20) NULL DEFAULT NULL COMMENT '单据id' , `each_amount` decimal(24,6) DEFAULT NULL COMMENT '单项金额', `remark` varchar(100) DEFAULT NULL COMMENT '单据备注', `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', @@ -94,12 +95,12 @@ CREATE TABLE `jsh_account_item` ( -- ---------------------------- -- Records of jsh_account_item -- ---------------------------- -INSERT INTO `jsh_account_item` VALUES ('143', '118', null, '23', '55.000000', '', '63', '0'); -INSERT INTO `jsh_account_item` VALUES ('144', '119', null, '21', '66.000000', '', '63', '0'); -INSERT INTO `jsh_account_item` VALUES ('145', '120', '17', null, '33.000000', '', '63', '0'); -INSERT INTO `jsh_account_item` VALUES ('146', '121', '18', null, '-22.000000', '', '63', '0'); -INSERT INTO `jsh_account_item` VALUES ('147', '122', '17', null, '11.000000', '', '63', '0'); -INSERT INTO `jsh_account_item` VALUES ('148', '123', '17', null, '66.000000', '', '63', '0'); +INSERT INTO `jsh_account_item` VALUES ('143', '118', null, '23', null, '55.000000', '', '63', '0'); +INSERT INTO `jsh_account_item` VALUES ('144', '119', null, '21', null, '66.000000', '', '63', '0'); +INSERT INTO `jsh_account_item` VALUES ('145', '120', '17', null, null, '33.000000', '', '63', '0'); +INSERT INTO `jsh_account_item` VALUES ('146', '121', '18', null, null, '-22.000000', '', '63', '0'); +INSERT INTO `jsh_account_item` VALUES ('147', '122', '17', null, null, '11.000000', '', '63', '0'); +INSERT INTO `jsh_account_item` VALUES ('148', '123', '17', null, null, '66.000000', '', '63', '0'); -- ---------------------------- -- Table structure for jsh_depot diff --git a/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt b/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt index ab1922c0..18c4d61e 100644 --- a/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt +++ b/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt @@ -1098,3 +1098,10 @@ update jsh_function set name='进销存统计', sort='0658' where id=59 -- 增加商品库存报表 -- -------------------------------------------------------- INSERT INTO `jsh_function` (`number`, `name`, `parent_number`, `url`, `component`, `state`, `sort`, `enabled`, `type`, `push_btn`, `icon`, `delete_flag`) VALUES ('030113', '商品库存', '0301', '/report/material_stock', '/report/MaterialStock', b'0', '0605', b'1', '电脑版', '', 'profile', '0'); + +-- -------------------------------------------------------- +-- 时间 2021年6月29日 +-- by jishenghua +-- 给功能表增加组件字段component +-- -------------------------------------------------------- +alter table jsh_account_item add bill_id bigint(20) DEFAULT NULL COMMENT '单据id' after in_out_item_id; \ No newline at end of file diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountItemController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountItemController.java index 2e6e22c6..9e0cae57 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountItemController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountItemController.java @@ -51,6 +51,7 @@ public class AccountItemController { item.put("accountName", ai.getAccountName()); item.put("inOutItemId", ai.getInOutItemId()); item.put("inOutItemName", ai.getInOutItemName()); + item.put("billNumber", ai.getBillNumber()); BigDecimal eachAmount = ai.getEachAmount(); item.put("eachAmount", (eachAmount.compareTo(BigDecimal.ZERO))==-1 ? BigDecimal.ZERO.subtract(eachAmount): eachAmount); item.put("remark", ai.getRemark()); diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/AccountItem.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/AccountItem.java index 2ef4550e..403457f3 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/AccountItem.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/AccountItem.java @@ -11,6 +11,8 @@ public class AccountItem { private Long inOutItemId; + private Long billId; + private BigDecimal eachAmount; private String remark; @@ -51,6 +53,14 @@ public class AccountItem { this.inOutItemId = inOutItemId; } + public Long getBillId() { + return billId; + } + + public void setBillId(Long billId) { + this.billId = billId; + } + public BigDecimal getEachAmount() { return eachAmount; } diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/AccountItemExample.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/AccountItemExample.java index f45dc2c0..afb201d8 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/AccountItemExample.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/AccountItemExample.java @@ -345,6 +345,66 @@ public class AccountItemExample { return (Criteria) this; } + public Criteria andBillIdIsNull() { + addCriterion("bill_id is null"); + return (Criteria) this; + } + + public Criteria andBillIdIsNotNull() { + addCriterion("bill_id is not null"); + return (Criteria) this; + } + + public Criteria andBillIdEqualTo(Long value) { + addCriterion("bill_id =", value, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdNotEqualTo(Long value) { + addCriterion("bill_id <>", value, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdGreaterThan(Long value) { + addCriterion("bill_id >", value, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdGreaterThanOrEqualTo(Long value) { + addCriterion("bill_id >=", value, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdLessThan(Long value) { + addCriterion("bill_id <", value, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdLessThanOrEqualTo(Long value) { + addCriterion("bill_id <=", value, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdIn(List values) { + addCriterion("bill_id in", values, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdNotIn(List values) { + addCriterion("bill_id not in", values, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdBetween(Long value1, Long value2) { + addCriterion("bill_id between", value1, value2, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdNotBetween(Long value1, Long value2) { + addCriterion("bill_id not between", value1, value2, "billId"); + return (Criteria) this; + } + public Criteria andEachAmountIsNull() { addCriterion("each_amount is null"); return (Criteria) this; diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/vo/AccountItemVo4List.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/vo/AccountItemVo4List.java index d3da5ada..73d74b48 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/vo/AccountItemVo4List.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/vo/AccountItemVo4List.java @@ -8,6 +8,8 @@ public class AccountItemVo4List extends AccountItem { private String inOutItemName; + private String billNumber; + public String getAccountName() { return accountName; } @@ -23,4 +25,12 @@ public class AccountItemVo4List extends AccountItem { public void setInOutItemName(String inOutItemName) { this.inOutItemName = inOutItemName; } + + public String getBillNumber() { + return billNumber; + } + + public void setBillNumber(String billNumber) { + this.billNumber = billNumber; + } } \ No newline at end of file diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/accountItem/AccountItemService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/accountItem/AccountItemService.java index fd9c5593..f1d3fea9 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/accountItem/AccountItemService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/accountItem/AccountItemService.java @@ -12,6 +12,7 @@ import com.jsh.erp.datasource.mappers.AccountItemMapperEx; import com.jsh.erp.datasource.vo.AccountItemVo4List; import com.jsh.erp.exception.BusinessRunTimeException; import com.jsh.erp.exception.JshException; +import com.jsh.erp.service.depotHead.DepotHeadService; import com.jsh.erp.service.log.LogService; import com.jsh.erp.service.user.UserService; import com.jsh.erp.utils.StringUtil; @@ -34,13 +35,14 @@ public class AccountItemService { @Resource private AccountItemMapper accountItemMapper; - @Resource private AccountItemMapperEx accountItemMapperEx; @Resource private LogService logService; @Resource private UserService userService; + @Resource + private DepotHeadService depotHeadService; public AccountItem getAccountItem(long id)throws Exception { AccountItem result=null; @@ -199,6 +201,10 @@ public class AccountItemService { if (tempInsertedJson.get("inOutItemId") != null && !tempInsertedJson.get("inOutItemId").equals("")) { accountItem.setInOutItemId(tempInsertedJson.getLong("inOutItemId")); } + if (tempInsertedJson.get("billNumber") != null && !tempInsertedJson.get("billNumber").equals("")) { + String billNo = tempInsertedJson.getString("billNumber"); + accountItem.setBillId(depotHeadService.getDepotHead(billNo).getId()); + } if (tempInsertedJson.get("eachAmount") != null && !tempInsertedJson.get("eachAmount").equals("")) { BigDecimal eachAmount = tempInsertedJson.getBigDecimal("eachAmount"); if (type.equals("付款")) { diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java index b0d38a14..94db7e53 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java @@ -670,4 +670,19 @@ public class DepotHeadService { public BigDecimal getBuyAndSaleRetailStatistics(String type, String subType, Integer hasSupplier, String beginTime, String endTime) { return depotHeadMapperEx.getBuyAndSaleRetailStatistics(type, subType, hasSupplier, beginTime, endTime); } + + public DepotHead getDepotHead(String number)throws Exception { + DepotHead depotHead = new DepotHead(); + try{ + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andNumberEqualTo(number).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = depotHeadMapper.selectByExample(example); + if(null!=list && list.size()>0) { + depotHead = list.get(0); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return depotHead; + } } diff --git a/jshERP-boot/src/main/resources/mapper_xml/AccountItemMapper.xml b/jshERP-boot/src/main/resources/mapper_xml/AccountItemMapper.xml index 87553b14..fcb141a0 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/AccountItemMapper.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/AccountItemMapper.xml @@ -6,6 +6,7 @@ + @@ -70,7 +71,8 @@ - id, header_id, account_id, in_out_item_id, each_amount, remark, tenant_id, delete_flag + id, header_id, account_id, in_out_item_id, bill_id, each_amount, remark, tenant_id, + delete_flag @@ -47,9 +48,10 @@