Explorar o código

1 结算详情添加日志

wuhp %!s(int64=2) %!d(string=hai) anos
pai
achega
bbc9663132

+ 4 - 0
sql/Online.sql

@@ -145,3 +145,7 @@ INSERT INTO `sys_menu`(`id`, `name`, `parent_id`, `url`, `perms`, `type`, `icon`
 INSERT INTO `sys_menu`(`id`, `name`, `parent_id`, `url`, `perms`, `type`, `icon`, `order_num`, `create_by`, `create_time`, `last_update_by`, `last_update_time`, `del_flag`) VALUES (676, '结算', '674', NULL, NULL, 2, NULL, 0, NULL, NULL, NULL, NULL, 0);
 INSERT INTO `sys_menu`(`id`, `name`, `parent_id`, `url`, `perms`, `type`, `icon`, `order_num`, `create_by`, `create_time`, `last_update_by`, `last_update_time`, `del_flag`) VALUES (677, '结算', '673', NULL, 'sys:documentaryFees1:balance', 2, NULL, 0, NULL, NULL, NULL, NULL, 0);
 INSERT INTO `sys_menu`(`id`, `name`, `parent_id`, `url`, `perms`, `type`, `icon`, `order_num`, `create_by`, `create_time`, `last_update_by`, `last_update_time`, `del_flag`) VALUES (678, '结算', '674', NULL, 'sys:documentaryFees2:balance', 2, NULL, 0, NULL, NULL, NULL, NULL, 0);
+
+
+--  2024-0422   武鸿鹏
+ALTER TABLE `settlement_documentary_log` ADD COLUMN `crud_status` varchar(5) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '操作表示 1.新增 2 修改  3 删除' AFTER `handing_amount`;

+ 5 - 0
src/main/java/com/ydtech/modules/fnc/entity/SettlementDocumentaryLogEntity.java

@@ -34,6 +34,11 @@ public class SettlementDocumentaryLogEntity implements Serializable {
     @TableField("amount_type")
     private String amountType;
 
+
+    @ApiModelProperty("操作标识  1.新增 2.修改 3.删除 ")
+    @TableField("crud_status")
+    private String crudStatus;
+
     @ApiModelProperty("创建时间")
     @TableField("create_time")
     private Date createTime;

+ 22 - 6
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -452,7 +452,6 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
 
     @Override
     public void importData(MultipartFile file, InsPlyIncomeVo insPlyIncomeVo) {
-//InsPlyIncomeExcelDto
         List<InsPlyIncome> list = null;
         try {
             List<InsPlyIncomeExcelDto> dtoList = ExcelEasypoiUtils.importExcel(file, InsPlyIncomeExcelDto.class, 0, 1, 1);
@@ -474,18 +473,30 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
     }
 
     @Override
+    @Transactional
     public void updateByEntity(InsPlyIncomeVo insPlyIncomeVo) {
         InsPlyIncome insPlyIncome = new InsPlyIncome();
         BeanUtils.copyProperties(insPlyIncomeVo, insPlyIncome);
         baseMapper.updateById(insPlyIncome);
+
+        insPlyIncomeVo.setCrudStatus("2");
+        this.saveLog(insPlyIncomeVo);
+
     }
 
-//    @Override
-//    public void insertByEntity(InsPlyIncomeVo insPlyIncomeVo) {
+    private void saveLog(InsPlyIncomeVo insPlyIncomeVo) {
+        //         添加记录
+        SettlementDocumentaryLogEntity settlementDocumentaryLogEntity = new SettlementDocumentaryLogEntity();
+        settlementDocumentaryLogEntity.setCrudStatus(insPlyIncomeVo.getCrudStatus());
+        settlementDocumentaryLogEntity.setAmount(insPlyIncomeVo.getOtherFeevalue());
+        settlementDocumentaryLogEntity.setSettlementDocumentaryId(insPlyIncomeVo.getId());
+        settlementDocumentaryLogEntity.setAmountType("2");
+        settlementDocumentaryLogService.save(settlementDocumentaryLogEntity);
+    }
 
-//    }
 
     @Override
+    @Transactional
     public HttpResult<InsPlyIncome> insertByEntity(InsPlyIncomeVo insPlyIncomeVo) {
         Long id = new SnowFlakeUtil().nextId();
         InsPlyIncome insPlyIncome = new InsPlyIncome();
@@ -496,6 +507,10 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         insPlyIncome.setIsNotCar("0");
         insPlyIncome.setIsNotDocumentary("1");
         baseMapper.insert(insPlyIncome);
+        insPlyIncomeVo.setId(insPlyIncome.getId());
+        insPlyIncomeVo.setCrudStatus("1");
+        this.saveLog(insPlyIncomeVo);   //添加日志
+
         HashMap<String, Object> params = new HashMap<>();
 
         if(StringUtils.isNotEmpty(insPlyIncomeVo.getIsNotCar())){
@@ -534,13 +549,14 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
             params.put("companyId",insPlyIncomeVo.getCompanyId());
         }
         baseMapper.deleteById(insPlyIncomeVo.getId());
-
+        insPlyIncomeVo.setCrudStatus("3");
+        this.saveLog(insPlyIncomeVo);
         List<InsPlyIncome> list = this.baseMapper.NonSettlementQuery(params);
         if (!CollectionUtils.isEmpty(list)) {
             for (InsPlyIncome item : list) {
                 return HttpResult.ok(item.getIds());
             }
-        } else  {
+        } else {
             return HttpResult.ok(null);
 
         }

+ 3 - 0
src/main/java/com/ydtech/modules/fnc/vo/InsPlyIncomeVo.java

@@ -139,4 +139,7 @@ public class InsPlyIncomeVo implements Serializable {
     @ApiModelProperty("其他费用比例")
     private BigDecimal otherFeerate;
 
+    @ApiModelProperty("操作标识")
+    private String crudStatus;
+
 }

+ 1 - 0
src/main/resources/mapper/modules/fnc/SettlementDocumentaryLogMapper.xml

@@ -10,6 +10,7 @@
         <result column="amount_type" property="amountType"/>
         <result column="create_time" property="createTime"/>
         <result column="handing_amount" property="handingAmount"/>
+        <result column="crud_status" property="crudStatus"/>
     </resultMap>