From 6a6662b03151abc8cf3e6059b83361f18e390191 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Tue, 30 Nov 2021 21:46:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=B0=E8=B4=A6=E6=94=AF=E5=87=BA=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/skyeye/dao/ExpenditureDao.java | 36 +---- .../java/com/skyeye/dao/IfsCommonDao.java | 78 +++++++++ .../com/skyeye/factory/IfsOrderFactory.java | 141 +++++++++++++++- .../skyeye/factory/IfsOrderFactoryResult.java | 7 + .../service/impl/ExpenditureServiceImpl.java | 115 +------------ .../service/impl/IncomeServiceImpl.java | 1 - .../mapper/ifs/ExpenditureMapper.xml | 152 ------------------ .../resources/mapper/ifs/IfsCommonMapper.xml | 119 +++++++++++++- 8 files changed, 351 insertions(+), 298 deletions(-) diff --git a/skyeye-ifs/src/main/java/com/skyeye/dao/ExpenditureDao.java b/skyeye-ifs/src/main/java/com/skyeye/dao/ExpenditureDao.java index f5879bebb..1e950ee52 100644 --- a/skyeye-ifs/src/main/java/com/skyeye/dao/ExpenditureDao.java +++ b/skyeye-ifs/src/main/java/com/skyeye/dao/ExpenditureDao.java @@ -4,36 +4,16 @@ package com.skyeye.dao; -import java.util.List; -import java.util.Map; - /** - * @Author: 卫志强 - * @Description: TODO - * @Date: 2019/10/20 10:23 + * + * @ClassName: ExpenditureDao + * @Description: 记账支出数据接口层 + * @author: skyeye云系列--卫志强 + * @date: 2021/11/30 21:40 + * + * @Copyright: 2021 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved. + * 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的 */ public interface ExpenditureDao { - public int insertExpenditure(Map params) throws Exception; - - public int insertExpenditureItem(List> entitys) throws Exception; - - public Map queryExpenditureToEditById(Map params) throws Exception; - - public int editExpenditureById(Map params) throws Exception; - - public int editExpenditureByDeleteFlag(Map params) throws Exception; - - public Map queryExpenditureDetailById(Map params) throws Exception; - - public List> queryExpenditureItemsDetailById(Map bean) throws Exception; - - public List> queryExpenditureItemsToEditById(Map params) throws Exception; - - public int editExpenditureItemsByDeleteFlag(Map params) throws Exception; - - public int deleteExpenditureItemById(Map params) throws Exception; - - public List> queryMationToExcel(Map params) throws Exception; - } diff --git a/skyeye-ifs/src/main/java/com/skyeye/dao/IfsCommonDao.java b/skyeye-ifs/src/main/java/com/skyeye/dao/IfsCommonDao.java index 9861f796d..d5a91bfe7 100644 --- a/skyeye-ifs/src/main/java/com/skyeye/dao/IfsCommonDao.java +++ b/skyeye-ifs/src/main/java/com/skyeye/dao/IfsCommonDao.java @@ -4,6 +4,8 @@ package com.skyeye.dao; +import org.apache.ibatis.annotations.Param; + import java.util.List; import java.util.Map; @@ -26,4 +28,80 @@ public interface IfsCommonDao { */ List> queryIfsOrderList(Map params) throws Exception; + /** + * 插入财务单据信息 + * + * @param orderMation + * @throws Exception + */ + void insertIfsOrderMation(Map orderMation) throws Exception; + + /** + * 插入财务单据关联信息 + * + * @param entitys + * @throws Exception + */ + void insertIfsOrderItemMation(List> entitys) throws Exception; + + /** + * 根据订单id获取订单信息用来编辑 + * + * @param orderId 订单id + * @return 订单信息 + * @throws Exception + */ + Map queryIfsOrderMationToEditById(@Param("orderId") String orderId) throws Exception; + + /** + * 根据订单id获取订单关联信息用来编辑 + * + * @param orderId 订单id + * @return 订单关联信息 + * @throws Exception + */ + List> queryIfsOrderItemMationToEditById(@Param("orderId") String orderId) throws Exception; + + /** + * 修改财务单据信息 + * + * @param orderMation + * @throws Exception + */ + void editIfsOrderMation(Map orderMation) throws Exception; + + /** + * 插入财务订单相关单据信息 + * + * @param orderId 订单id + * @throws Exception + */ + void deleteIfsOrderItemMationByOrderId(@Param("orderId") String orderId) throws Exception; + + /** + * 删除单据信息 + * + * @param orderId 订单id + * @throws Exception + */ + void deleteIfsOrderMationById(@Param("orderId") String orderId) throws Exception; + + /** + * 根据订单id获取订单信息 + * + * @param orderId 订单id + * @return 订单信息 + * @throws Exception + */ + Map queryIfsOrderMationDetailsById(@Param("orderId") String orderId) throws Exception; + + /** + * 根据订单id获取订单关联信息 + * + * @param orderId 订单id + * @return 订单关联信息 + * @throws Exception + */ + List> queryIfsOrderItemMationDetailsById(@Param("orderId") String orderId) throws Exception; + } diff --git a/skyeye-ifs/src/main/java/com/skyeye/factory/IfsOrderFactory.java b/skyeye-ifs/src/main/java/com/skyeye/factory/IfsOrderFactory.java index 1b9ab4d26..b62d33bba 100644 --- a/skyeye-ifs/src/main/java/com/skyeye/factory/IfsOrderFactory.java +++ b/skyeye-ifs/src/main/java/com/skyeye/factory/IfsOrderFactory.java @@ -4,15 +4,22 @@ package com.skyeye.factory; +import cn.hutool.json.JSONUtil; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; +import com.skyeye.common.constans.ErpConstants; import com.skyeye.common.object.InputObject; import com.skyeye.common.object.OutputObject; import com.skyeye.common.util.SpringUtils; +import com.skyeye.common.util.ToolUtil; import com.skyeye.dao.IfsCommonDao; +import com.skyeye.eve.dao.SysEveUserStaffDao; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -30,6 +37,8 @@ public abstract class IfsOrderFactory { protected IfsCommonDao ifsCommonDao; + protected SysEveUserStaffDao sysEveUserStaffDao; + protected InputObject inputObject; protected OutputObject outputObject; @@ -55,6 +64,7 @@ public abstract class IfsOrderFactory { */ protected void initObject(){ ifsCommonDao = SpringUtils.getBean(IfsCommonDao.class); + sysEveUserStaffDao = SpringUtils.getBean(SysEveUserStaffDao.class); } /** @@ -89,7 +99,32 @@ public abstract class IfsOrderFactory { * @throws Exception */ public void insertOrderMation() throws Exception { - + Map params = inputObject.getParams(); + // 财务主表ID + String orderId = ToolUtil.getSurFaceId(); + // 财务子表实体集合信息 + List> entitys = new ArrayList<>(); + BigDecimal allPrice = getAllPriceAndChildList(orderId, params.get("initemStr").toString(), entitys); + if(entitys.size() == 0){ + outputObject.setreturnMessage("请选择支出项目"); + return; + } + Map accountHead = new HashMap<>(); + String orderNum = ErpConstants.DepoTheadSubType.getOrderNumBySubType(orderType); + accountHead.put("id", orderId); + accountHead.put("type", orderType); + accountHead.put("billNo", orderNum); + accountHead.put("totalPrice", allPrice); + accountHead.put("organId", params.get("organId")); + accountHead.put("operTime", params.get("operTime")); + accountHead.put("accountId", params.get("accountId")); + accountHead.put("handsPersonId", params.get("handsPersonId")); + accountHead.put("remark", params.get("remark")); + accountHead.put("changeAmount", params.get("changeAmount")); + accountHead.put("deleteFlag", 0); + ifsCommonDao.insertIfsOrderMation(accountHead); + ifsCommonDao.insertIfsOrderItemMation(entitys); + this.insertOrderOtherMation(params, orderId); } /** @@ -102,6 +137,28 @@ public abstract class IfsOrderFactory { protected void insertOrderOtherMation(Map inputParams, String orderId) throws Exception{ } + private BigDecimal getAllPriceAndChildList(String orderId, String itemStr, List> entitys) { + List> jArray = JSONUtil.toList(itemStr, null); + // 主单总价 + BigDecimal allPrice = new BigDecimal("0"); + for(int i = 0; i < jArray.size(); i++){ + Map bean = jArray.get(i); + Map entity = new HashMap<>(); + // 获取子项金额 + BigDecimal itemAllPrice = new BigDecimal(bean.get("initemMoney").toString()); + entity.put("id", ToolUtil.getSurFaceId()); + entity.put("headerId", orderId); + entity.put("inOutItemId", bean.get("initemId")); + entity.put("eachAmount", bean.get("initemMoney")); + entity.put("remark", bean.get("remark")); + entity.put("deleteFlag", 0); + entitys.add(entity); + // 计算总金额 + allPrice = allPrice.add(itemAllPrice); + } + return allPrice; + } + /** * 编辑时获取订单数据进行回显 * @@ -109,8 +166,21 @@ public abstract class IfsOrderFactory { * @throws Exception */ public Map queryOrderMationToEditById() throws Exception{ - - return null; + Map params = inputObject.getParams(); + String orderId = params.get("id").toString(); + Map bean = ifsCommonDao.queryIfsOrderMationToEditById(orderId); + if(bean != null && !bean.isEmpty()){ + List> beans = ifsCommonDao.queryIfsOrderItemMationToEditById(orderId); + bean.put("items", beans); + // 获取经手人员 + bean.put("userInfo", sysEveUserStaffDao.queryUserNameList(bean.get("handsPersonId").toString())); + this.quertOrderOtherMationToEditById(bean, orderId); + outputObject.setBean(bean); + outputObject.settotal(1); + }else{ + outputObject.setreturnMessage("未查询到信息!"); + } + return bean; } /** @@ -121,7 +191,6 @@ public abstract class IfsOrderFactory { * @throws Exception */ protected void quertOrderOtherMationToEditById(Map bean, String orderId) throws Exception{ - } /** @@ -130,7 +199,29 @@ public abstract class IfsOrderFactory { * @throws Exception */ public void editOrderMationById() throws Exception{ - + Map params = inputObject.getParams(); + String orderId = params.get("id").toString(); + // 财务子表实体集合信息 + List> entitys = new ArrayList<>(); + BigDecimal allPrice = getAllPriceAndChildList(orderId, params.get("initemStr").toString(), entitys); + if(entitys.size() == 0){ + outputObject.setreturnMessage("请选择支出项目"); + return; + } + Map accountHead = new HashMap<>(); + accountHead.put("id", orderId); + accountHead.put("totalPrice", allPrice); + accountHead.put("organId", params.get("organId")); + accountHead.put("operTime", params.get("operTime")); + accountHead.put("accountId", params.get("accountId")); + accountHead.put("handsPersonId", params.get("handsPersonId")); + accountHead.put("remark", params.get("remark")); + accountHead.put("changeAmount", params.get("changeAmount")); + ifsCommonDao.editIfsOrderMation(accountHead); + // 删除之前的绑定信息 + ifsCommonDao.deleteIfsOrderItemMationByOrderId(orderId); + ifsCommonDao.insertIfsOrderItemMation(entitys); + this.editOrderOtherMationById(params, orderId); } /** @@ -141,7 +232,6 @@ public abstract class IfsOrderFactory { * @throws Exception */ protected void editOrderOtherMationById(Map inputParams, String orderId) throws Exception{ - } /** @@ -150,7 +240,13 @@ public abstract class IfsOrderFactory { * @throws Exception */ public void deleteOrderMationById() throws Exception{ - + Map params = inputObject.getParams(); + String orderId = params.get("id").toString(); + // 删除订单信息 + ifsCommonDao.deleteIfsOrderMationById(orderId); + // 删除绑定信息 + ifsCommonDao.deleteIfsOrderItemMationByOrderId(orderId); + this.deleteOrderOtherMationById(params); } /** @@ -160,7 +256,38 @@ public abstract class IfsOrderFactory { * @throws Exception */ protected void deleteOrderOtherMationById(Map orderMation) throws Exception{ + } + /** + * 获取订单详情 + * + * @throws Exception + */ + public Map queryOrderMationDetailsById() throws Exception{ + Map params = inputObject.getParams(); + String orderId = params.get("id").toString(); + // 获取财务主表信息 + Map bean = ifsCommonDao.queryIfsOrderMationDetailsById(orderId); + if(bean != null && !bean.isEmpty()){ + // 获取子表信息 + List> beans = ifsCommonDao.queryIfsOrderItemMationDetailsById(orderId); + bean.put("items", beans); + this.queryOrderOtherDetailsMationById(bean); + outputObject.setBean(bean); + outputObject.settotal(1); + }else{ + outputObject.setreturnMessage("该数据已不存在."); + } + return bean; + } + + /** + * 获取订单详情时,操作其他数据 + * + * @param orderMation 订单信息 + * @throws Exception + */ + protected void queryOrderOtherDetailsMationById(Map orderMation) throws Exception{ } /** diff --git a/skyeye-ifs/src/main/java/com/skyeye/factory/IfsOrderFactoryResult.java b/skyeye-ifs/src/main/java/com/skyeye/factory/IfsOrderFactoryResult.java index e8ef8ef8e..dc6f7a286 100644 --- a/skyeye-ifs/src/main/java/com/skyeye/factory/IfsOrderFactoryResult.java +++ b/skyeye-ifs/src/main/java/com/skyeye/factory/IfsOrderFactoryResult.java @@ -53,6 +53,13 @@ public interface IfsOrderFactoryResult { */ void deleteOrderMationById() throws Exception; + /** + * 获取订单详情 + * + * @throws Exception + */ + Map queryOrderMationDetailsById() throws Exception; + /** * 单据提交审核 * diff --git a/skyeye-ifs/src/main/java/com/skyeye/service/impl/ExpenditureServiceImpl.java b/skyeye-ifs/src/main/java/com/skyeye/service/impl/ExpenditureServiceImpl.java index 589ebe669..76fac46cd 100644 --- a/skyeye-ifs/src/main/java/com/skyeye/service/impl/ExpenditureServiceImpl.java +++ b/skyeye-ifs/src/main/java/com/skyeye/service/impl/ExpenditureServiceImpl.java @@ -4,23 +4,17 @@ package com.skyeye.service.impl; -import cn.hutool.json.JSONUtil; import com.skyeye.common.constans.ErpConstants; import com.skyeye.common.object.InputObject; import com.skyeye.common.object.OutputObject; import com.skyeye.common.util.ExcelUtil; -import com.skyeye.common.util.ToolUtil; import com.skyeye.dao.ExpenditureDao; -import com.skyeye.eve.dao.SysEveUserStaffDao; import com.skyeye.factory.IfsOrderRunFactory; import com.skyeye.service.ExpenditureService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; @@ -39,9 +33,6 @@ public class ExpenditureServiceImpl implements ExpenditureService { @Autowired private ExpenditureDao expenditureDao; - - @Autowired - private SysEveUserStaffDao sysEveUserStaffDao; /** * 记账支出类型 @@ -68,53 +59,7 @@ public class ExpenditureServiceImpl implements ExpenditureService { @Override @Transactional(value="transactionManager") public void insertExpenditure(InputObject inputObject, OutputObject outputObject) throws Exception { - Map params = inputObject.getParams(); - // 财务主表ID - String useId = ToolUtil.getSurFaceId(); - // 财务子表实体集合信息 - List> entitys = new ArrayList<>(); - BigDecimal allPrice = getAllPriceAndChildList(useId, params.get("initemStr").toString(), entitys); - if(entitys.size() == 0){ - outputObject.setreturnMessage("请选择支出项目"); - return; - } - Map accountHead = new HashMap<>(); - String orderNum = ErpConstants.DepoTheadSubType.getOrderNumBySubType(ORDER_TYPE); - accountHead.put("id", useId); - accountHead.put("type", ORDER_TYPE);//记账支出 - accountHead.put("billNo", orderNum); - accountHead.put("totalPrice", allPrice); - accountHead.put("organId", params.get("organId")); - accountHead.put("operTime", params.get("operTime")); - accountHead.put("accountId", params.get("accountId")); - accountHead.put("handsPersonId", params.get("handsPersonId")); - accountHead.put("remark", params.get("remark")); - accountHead.put("changeAmount", params.get("changeAmount")); - accountHead.put("deleteFlag", 0); - expenditureDao.insertExpenditure(accountHead); - expenditureDao.insertExpenditureItem(entitys); - } - - private BigDecimal getAllPriceAndChildList(String useId, String initemStr, List> entitys) { - List> jArray = JSONUtil.toList(initemStr, null); - // 主单总价 - BigDecimal allPrice = new BigDecimal("0"); - for(int i = 0; i < jArray.size(); i++){ - Map bean = jArray.get(i); - Map entity = new HashMap<>(); - // 获取子项金额 - BigDecimal itemAllPrice = new BigDecimal(bean.get("initemMoney").toString()); - entity.put("id", ToolUtil.getSurFaceId()); - entity.put("headerId", useId); - entity.put("inOutItemId", bean.get("initemId")); - entity.put("eachAmount", bean.get("initemMoney")); - entity.put("remark", bean.get("remark")); - entity.put("deleteFlag", 0); - entitys.add(entity); - // 计算总金额 - allPrice = allPrice.add(itemAllPrice); - } - return allPrice; + IfsOrderRunFactory.run(inputObject, outputObject, ORDER_TYPE).insertOrderMation(); } /** @@ -125,18 +70,7 @@ public class ExpenditureServiceImpl implements ExpenditureService { */ @Override public void queryExpenditureToEditById(InputObject inputObject, OutputObject outputObject) throws Exception { - Map params = inputObject.getParams(); - Map bean = expenditureDao.queryExpenditureToEditById(params); - if(bean != null && !bean.isEmpty()){ - List> beans = expenditureDao.queryExpenditureItemsToEditById(params); - bean.put("items", beans); - // 获取经手人员 - bean.put("userInfo", sysEveUserStaffDao.queryUserNameList(bean.get("handsPersonId").toString())); - outputObject.setBean(bean); - outputObject.settotal(1); - }else{ - outputObject.setreturnMessage("未查询到信息!"); - } + IfsOrderRunFactory.run(inputObject, outputObject, ORDER_TYPE).queryOrderMationToEditById(); } /** @@ -148,28 +82,7 @@ public class ExpenditureServiceImpl implements ExpenditureService { @Override @Transactional(value="transactionManager") public void editExpenditureById(InputObject inputObject, OutputObject outputObject) throws Exception { - Map params = inputObject.getParams(); - String useId = params.get("id").toString(); - // 财务子表实体集合信息 - List> entitys = new ArrayList<>(); - BigDecimal allPrice = getAllPriceAndChildList(useId, params.get("initemStr").toString(), entitys); - if(entitys.size() == 0){ - outputObject.setreturnMessage("请选择支出项目"); - return; - } - Map accountHead = new HashMap<>(); - accountHead.put("id", useId); - accountHead.put("totalPrice", allPrice); - accountHead.put("organId", params.get("organId")); - accountHead.put("operTime", params.get("operTime")); - accountHead.put("accountId", params.get("accountId")); - accountHead.put("handsPersonId", params.get("handsPersonId")); - accountHead.put("remark", params.get("remark")); - accountHead.put("changeAmount", params.get("changeAmount")); - expenditureDao.editExpenditureById(accountHead); - // 删除之前的绑定信息 - expenditureDao.deleteExpenditureItemById(params); - expenditureDao.insertExpenditureItem(entitys); + IfsOrderRunFactory.run(inputObject, outputObject, ORDER_TYPE).editOrderMationById(); } /** @@ -181,10 +94,7 @@ public class ExpenditureServiceImpl implements ExpenditureService { @Override @Transactional(value="transactionManager") public void deleteExpenditureById(InputObject inputObject, OutputObject outputObject) throws Exception { - Map params = inputObject.getParams(); - params.put("deleteFlag", 1); - expenditureDao.editExpenditureByDeleteFlag(params); - expenditureDao.editExpenditureItemsByDeleteFlag(params); + IfsOrderRunFactory.run(inputObject, outputObject, ORDER_TYPE).deleteOrderMationById(); } /** @@ -195,18 +105,7 @@ public class ExpenditureServiceImpl implements ExpenditureService { */ @Override public void queryExpenditureByDetail(InputObject inputObject, OutputObject outputObject) throws Exception { - Map params = inputObject.getParams(); - // 获取财务主表信息 - Map bean = expenditureDao.queryExpenditureDetailById(params); - if(bean != null && !bean.isEmpty()){ - // 获取子表信息 - List> beans = expenditureDao.queryExpenditureItemsDetailById(bean); - bean.put("items", beans); - outputObject.setBean(bean); - outputObject.settotal(1); - }else{ - outputObject.setreturnMessage("该数据已不存在."); - } + IfsOrderRunFactory.run(inputObject, outputObject, ORDER_TYPE).queryOrderMationDetailsById(); } /** @@ -217,9 +116,7 @@ public class ExpenditureServiceImpl implements ExpenditureService { */ @Override public void queryMationToExcel(InputObject inputObject, OutputObject outputObject) throws Exception { - Map params = inputObject.getParams(); - params.put("type", ORDER_TYPE); - List> beans = expenditureDao.queryMationToExcel(params); + List> beans = IfsOrderRunFactory.run(inputObject, outputObject, ORDER_TYPE).queryOrderList(); String[] key = new String[]{"billNo", "supplierName", "totalPrice", "hansPersonName", "billTime"}; String[] column = new String[]{"单据编号", "往来单位", "合计金额", "经手人", "单据日期"}; String[] dataType = new String[]{"", "data", "data", "data", "data"}; diff --git a/skyeye-ifs/src/main/java/com/skyeye/service/impl/IncomeServiceImpl.java b/skyeye-ifs/src/main/java/com/skyeye/service/impl/IncomeServiceImpl.java index 953617de2..df53e087b 100644 --- a/skyeye-ifs/src/main/java/com/skyeye/service/impl/IncomeServiceImpl.java +++ b/skyeye-ifs/src/main/java/com/skyeye/service/impl/IncomeServiceImpl.java @@ -71,7 +71,6 @@ public class IncomeServiceImpl implements IncomeService { * @param outputObject * @throws Exception */ - @SuppressWarnings("unchecked") @Override @Transactional(value="transactionManager") public void insertIncome(InputObject inputObject, OutputObject outputObject) throws Exception { diff --git a/skyeye-ifs/src/main/resources/mapper/ifs/ExpenditureMapper.xml b/skyeye-ifs/src/main/resources/mapper/ifs/ExpenditureMapper.xml index f989a311a..f03bdeaf9 100644 --- a/skyeye-ifs/src/main/resources/mapper/ifs/ExpenditureMapper.xml +++ b/skyeye-ifs/src/main/resources/mapper/ifs/ExpenditureMapper.xml @@ -2,156 +2,4 @@ - - INSERT INTO erp_accounthead( - id, type, organ_id, hands_person_id, change_amount, total_price, account_id, bill_no, bill_time, remark, delete_flag - ) VALUES - (#{id}, #{type}, #{organId}, #{handsPersonId}, #{changeAmount}, #{totalPrice}, #{accountId}, #{billNo}, #{operTime}, #{remark}, #{deleteFlag}) - - - - INSERT INTO erp_accountitem( - id, header_id, in_out_item_id, each_amount, remark, delete_flag - ) VALUES - - (#{item.id}, #{item.headerId}, #{item.inOutItemId}, #{item.eachAmount}, #{item.remark}, #{item.deleteFlag}) - - - - - - - - - UPDATE erp_accounthead - - organ_id = #{organId}, - hands_person_id = #{handsPersonId}, - change_amount = #{changeAmount}, - total_price = #{totalPrice}, - account_id = #{accountId}, - bill_time = #{operTime}, - remark = #{remark} - - WHERE - id = #{id} - - - - DELETE - FROM - erp_accountitem - WHERE - header_id = #{id} - - - - UPDATE erp_accounthead - - delete_flag = #{deleteFlag} - - WHERE - id = #{id} - - - - UPDATE erp_accountitem - - delete_flag = #{deleteFlag} - - WHERE - header_id = #{id} - - - - - - - - \ No newline at end of file diff --git a/skyeye-ifs/src/main/resources/mapper/ifs/IfsCommonMapper.xml b/skyeye-ifs/src/main/resources/mapper/ifs/IfsCommonMapper.xml index 910a778f4..13fb11d4c 100644 --- a/skyeye-ifs/src/main/resources/mapper/ifs/IfsCommonMapper.xml +++ b/skyeye-ifs/src/main/resources/mapper/ifs/IfsCommonMapper.xml @@ -23,7 +23,124 @@ AND a.bill_time >= #{startTime} AND #{endTime} >= a.bill_time - ORDER BY a.bill_time DESC, a.id ASC + ORDER BY a.bill_time DESC + + + + INSERT INTO erp_accounthead + (id, type, organ_id, hands_person_id, change_amount, total_price, account_id, bill_no, bill_time, remark, delete_flag) + VALUES + (#{id}, #{type}, #{organId}, #{handsPersonId}, #{changeAmount}, #{totalPrice}, #{accountId}, #{billNo}, #{operTime}, #{remark}, #{deleteFlag}) + + + + INSERT INTO erp_accountitem + (id, header_id, in_out_item_id, each_amount, remark, delete_flag) + VALUES + + (#{item.id}, #{item.headerId}, #{item.inOutItemId}, #{item.eachAmount}, #{item.remark}, #{item.deleteFlag}) + + + + + + + + + UPDATE erp_accounthead + + organ_id = #{organId}, + hands_person_id = #{handsPersonId}, + change_amount = #{changeAmount}, + total_price = #{totalPrice}, + account_id = #{accountId}, + bill_time = #{operTime}, + remark = #{remark} + + WHERE + id = #{id} + + + + DELETE + FROM + erp_accounthead + WHERE + id = #{orderId} + + + + DELETE + FROM + erp_accountitem + WHERE + header_id = #{orderId} + + + + + \ No newline at end of file -- GitLab