dongke 2 лет назад
Родитель
Сommit
f8fe87e7a1

+ 2 - 2
src/main/java/com/dk/mdm/mapper/mst/MoneyAccountMapper.xml

@@ -16,7 +16,7 @@
             <result column="balance" property="balance"/>
             <result column="display_no" property="displayNo"/>
             <result column="flg_default" property="flgDefault"/>
-            <result column="mac_receipt_code" property="macReceiptCode"/>
+            <result column="mac_receipt_code" property="macReceiptCode" typeHandler="JsonTypeHandler"/>
             <result column="acc_date" property="accDate"/>
             <result column="flg_negative" property="flgNegative"/>
             <result column="remarks" property="remarks"/>
@@ -33,7 +33,7 @@
             <result column="balance" property="balance"/>
             <result column="display_no" property="displayNo"/>
             <result column="flg_default" property="flgDefault"/>
-            <result column="mac_receipt_code" property="macReceiptCode"/>
+            <result column="mac_receipt_code" property="macReceiptCode" typeHandler="JsonTypeHandler"/>
             <result column="acc_date" property="accDate"/>
             <result column="flg_negative" property="flgNegative"/>
             <result column="remarks" property="remarks"/>

+ 1 - 1
src/main/java/com/dk/mdm/mapper/mst/SupplierMapper.java

@@ -48,7 +48,7 @@ public interface SupplierMapper extends BaseMapper<Supplier>{
      * @author : 王英杰
      * @date   : 2024/2/29 17:49
      */
-    int   batchDeleteBrand (List<String> supIdList );
+    int   batchDeleteBrand (String supId );
     /**
      * @desc   : 自动生id
      * @author : 王英杰

+ 4 - 1
src/main/java/com/dk/mdm/mapper/mst/SupplierMapper.xml

@@ -5,7 +5,10 @@
     <!-- 通用设置 -->
     <!-- 通用查询列 -->
     <sql id="Base_Column_List">
-        sup_id, sup_code, sup_name, sup_type, contact_name, contact_phone, org_id, staff_id, service_categories, remarks, flg_valid, cp_id, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
+        sup_id, sup_code, sup_name, sup_type, contact_name,
+contact_phone, org_id, staff_id, service_categories,
+remarks, flg_valid, cp_id, op_create_time, op_create_user_id,
+op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user,return_address
     </sql>
 <!--    ,taobj.sum_residue-->
     <sql id="msl_Base_Column_List">

+ 5 - 1
src/main/java/com/dk/mdm/mapper/pur/PurchaseMapper.xml

@@ -392,6 +392,10 @@
             <if test="makeTime != null">
                 AND tpp.make_time = #{makeTime}
             </if>
+            <if test="makeTimeStart != null and makeTimeEnd != null">
+                AND t.make_time &gt;= #{makeTimeStart}::timestamp with time zone
+                AND t.make_time &lt; #{makeTimeEnd}::timestamp with time zone + interval '1 day'
+            </if>
             <if test="flgValid != null">
                 AND tpp.flg_valid = #{flgValid}
             </if>
@@ -480,7 +484,7 @@
         left join sys.t_data_kind tdk1 on tdk1.kind_code = tpp.into_status
         left join sys.t_data_kind tdk2 on tdk2.kind_code = tpp.pur_status
         <include refid="Condition_1"/>
-            order by  tpp.op_create_time desc
+            order by  tpp.make_time desc
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
         </if>

+ 4 - 1
src/main/java/com/dk/mdm/model/pojo/mst/MoneyAccount.java

@@ -1,6 +1,7 @@
 package com.dk.mdm.model.pojo.mst;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.annotation.*;
 import java.io.Serializable;
 
@@ -98,7 +99,9 @@ public class MoneyAccount extends PageInfo<MoneyAccount> implements Serializable
      */
     @Excel(name = "收款码 (图片路径)")
     @ApiModelProperty(value = "收款码 (图片路径)")
-    private String macReceiptCode;
+    @TableField(typeHandler = JsonTypeHandler.class)
+    private JSONArray macReceiptCode;
+
 
 
     /**

+ 1 - 1
src/main/java/com/dk/mdm/model/pojo/mst/Supplier.java

@@ -235,7 +235,7 @@ public class Supplier extends PageInfo<Supplier> implements Serializable {
     @ApiModelProperty(value = "供应品牌")
     private List<String> brandIds;
 
-    @TableField(exist = false)
+
     @ApiModelProperty(value = "退货地址")
     private String returnAddress;
     /*

+ 4 - 1
src/main/java/com/dk/mdm/model/query/mst/MoneyAccountQuery.java

@@ -1,9 +1,11 @@
 package com.dk.mdm.model.query.mst;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.dk.common.infrastructure.annotaiton.ExportTitle;
+import com.dk.common.infrastructure.handler.JsonTypeHandler;
 import com.dk.common.infrastructure.handler.TimestampTypeHandler;
 import com.dk.common.infrastructure.handler.UuidTypeHandler;
 import com.dk.common.model.pojo.PageInfo;
@@ -101,7 +103,8 @@ public class MoneyAccountQuery extends PageInfo<MoneyAccountQuery> implements Se
      */
     @Excel(name = "收款码 (图片路径)")
     @ApiModelProperty(value = "收款码 (图片路径)")
-    private String macReceiptCode;
+    @TableField(typeHandler = JsonTypeHandler.class)
+    private JSONArray macReceiptCode;
 
 
     /**

+ 6 - 0
src/main/java/com/dk/mdm/model/query/pur/PurchaseQuery.java

@@ -72,7 +72,13 @@ public class PurchaseQuery extends PageInfo<PurchaseQuery> implements Serializab
     @ApiModelProperty(value = "订单类型 (【系统字典】采购订单)")
     private String purType;
 
+    @ApiModelProperty(value = "制单时间开始")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate makeTimeStart;
 
+    @ApiModelProperty(value = "制单时间结束")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate makeTimeEnd;
     /**
      * 部门
      */

+ 5 - 1
src/main/java/com/dk/mdm/model/response/mst/MoneyAccountResponse.java

@@ -1,9 +1,11 @@
 package com.dk.mdm.model.response.mst;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.dk.common.infrastructure.annotaiton.ExportTitle;
+import com.dk.common.infrastructure.handler.JsonTypeHandler;
 import com.dk.common.infrastructure.handler.TimestampTypeHandler;
 import com.dk.common.infrastructure.handler.UuidTypeHandler;
 import com.dk.common.model.pojo.PageInfo;
@@ -95,12 +97,14 @@ public class MoneyAccountResponse extends PageInfo<MoneyAccountResponse> impleme
     private Boolean flgDefault;
 
 
+
     /**
      * 收款码 (图片路径)
      */
     @Excel(name = "收款码 (图片路径)")
     @ApiModelProperty(value = "收款码 (图片路径)")
-    private String macReceiptCode;
+    @TableField(typeHandler = JsonTypeHandler.class)
+    private JSONArray macReceiptCode;
 
 
     /**

+ 4 - 1
src/main/java/com/dk/mdm/model/vo/mst/MoneyAccountVO.java

@@ -1,9 +1,11 @@
 package com.dk.mdm.model.vo.mst;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.dk.common.infrastructure.annotaiton.ExportTitle;
+import com.dk.common.infrastructure.handler.JsonTypeHandler;
 import com.dk.common.infrastructure.handler.TimestampTypeHandler;
 import com.dk.common.infrastructure.handler.UuidTypeHandler;
 import com.dk.common.model.pojo.PageInfo;
@@ -101,7 +103,8 @@ public class MoneyAccountVO extends PageInfo<MoneyAccountVO> implements Serializ
      */
     @Excel(name = "收款码 (图片路径)")
     @ApiModelProperty(value = "收款码 (图片路径)")
-    private String macReceiptCode;
+    @TableField(typeHandler = JsonTypeHandler.class)
+    private JSONArray macReceiptCode;
 
 
     /**

+ 1 - 1
src/main/java/com/dk/mdm/service/mst/MoneyAccountService.java

@@ -178,7 +178,7 @@ public class MoneyAccountService extends BaseService<MoneyAccount> {
 	public ResponseResultVO<Boolean> update(MoneyAccountVO moneyAccountVO) {
 		// 转化实体
 		MoneyAccount moneyAccount = moneyAccountConvert.convertToPo(moneyAccountVO);
-		super.update(moneyAccount, new UpdateWrapper<MoneyAccount>().lambda().eq(MoneyAccount::getMacId,
+			super.update(moneyAccount, new UpdateWrapper<MoneyAccount>().lambda().eq(MoneyAccount::getMacId,
 				UUID.fromString(moneyAccount.getMacId())));
 
 		// 赋值期初

+ 6 - 8
src/main/java/com/dk/mdm/service/mst/SupplierService.java

@@ -80,7 +80,10 @@ public class SupplierService extends BaseService<Supplier> {
             // 转账明细
             List<OtherPayableResponse> itemList = otherPayableMapper.selectByCond(new OtherPayableQuery().setObjectId(list.get(i).getSupId()).setBusinessType(0));
             if(itemList.size()>0){
-                list.get(i).setSumAmtPayable(itemList.get(0).getSumAmtPayable());
+                BigDecimal sumAmtPayableValue = (itemList != null && !itemList.isEmpty() && itemList.get(0).getSumAmtPayable() != null) ?
+                        itemList.get(0).getSumAmtPayable() :
+                        BigDecimal.ZERO;
+                list.get(i).setSumAmtPayable(sumAmtPayableValue);
             }
         }
 
@@ -156,10 +159,9 @@ public class SupplierService extends BaseService<Supplier> {
     public ResponseResultVO<?> update(SupplierVo supplierVo) {
         // 转化实体
         Supplier supplier = supplierConvert.convertToPo(supplierVo);
-        try {
-          super.updateByUuid(supplier);// 先更新的供应商表
+       super.updateByUuid(supplier);// 先更新的供应商表
             if ((supplier.getBrandIds() != null) && (supplier.getBrandIds().size()>0)) {  //如果有 商品品牌 一起插入品牌
-                supplierMapper.batchDeleteBrand(supplier.getBrandIds());//批量删除供应商对应的供应商品牌
+                supplierMapper.batchDeleteBrand(supplier.getSupId());//批量删除供应商对应的供应商品牌
                 List<Supplier>  Supplierlst   = new ArrayList<>();
                 List<String> BrandIdList =  new ArrayList<>();
                 BrandIdList = supplier.getBrandIds();
@@ -173,10 +175,6 @@ public class SupplierService extends BaseService<Supplier> {
                 supplierMapper.insertSupplierBrandtBatch(Supplierlst); // 向供应商品牌表插入数据
             }
           return ResponseResultUtil.success();
-        } catch (Exception e) {
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); // 手动回滚事务
 
-            return ResponseResultUtil.error("更新失败");
-        }
     }
 }

+ 2 - 0
src/main/java/com/dk/mdm/service/pur/PurchaseService.java

@@ -171,6 +171,7 @@ public class PurchaseService extends BaseService<Purchase> {
             purchaseItem.setIntoStatus(Constant.IntoStatus.DAIRUKU.getName());
             purchaseItem.setCpId(purchase.getCpId());
             purchaseItem.setItemId(null);
+            purchaseItem.setPriceDiscount(purchaseItemVO.getPriceDiscount());
             purchaseItemMapper.insert(purchaseItem);
         }
         //endregion
@@ -245,6 +246,7 @@ public class PurchaseService extends BaseService<Purchase> {
             purchaseItem.setCpId(purchase.getCpId());
             purchaseItem.setFromId(purchaseItemVO.getFromId());
             purchaseItem.setFromItemId(purchaseItemVO.getFromItemId());
+            purchaseItem.setPriceDiscount(purchaseItemVO.getPriceDiscount());
             purchaseItemMapper.insert(purchaseItem);
         }
         // 编辑的