Просмотр исходного кода

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss-server-mdm

jiangn 1 год назад
Родитель
Сommit
fc67f83835

+ 6 - 0
src/main/java/com/dk/mdm/mapper/common/CommonMapper.xml

@@ -269,6 +269,9 @@
         from dkic_b.t_mst_role
         where cp_id = #{cpId}
           and flg_valid
+        <if test="searchText !=null">
+            AND   role_name LIKE concat('%', my_ex.likequery(#{searchText}), '%')
+        </if>
         order by display_no
     </select>
 
@@ -1122,6 +1125,9 @@
         <if test="whId != null">
             AND tpi.wh_id = #{whId} ::uuid
         </if>
+        <if test="inqtyFlag != null">
+            AND tpi.inv_qty != 0
+        </if>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
         </if>

+ 9 - 1
src/main/java/com/dk/mdm/mapper/ivt/FreezeMapper.xml

@@ -73,6 +73,12 @@
       <!-- 通用条件列 -->
     <sql id="Condition">
         <where>
+            <if test="staffIds != null and staffIds.size()>0">
+                AND staff.staff_id = any(#{staffIds, typeHandler=uuidListTypeHandler})
+            </if>
+            <if test="orgIds != null and orgIds.size()>0">
+                AND org.org_id = any(#{orgIds, typeHandler=uuidListTypeHandler})
+            </if>
             <if test="cusPhone != null and cusPhone != ''">
                 AND cus.cus_phone like concat('%', my_ex.likequery(#{cusPhone}) , '%')
             </if>
@@ -80,7 +86,9 @@
                 AND cus.cus_name LIKE concat('%',my_ex.likequery(#{cusName}),'%')
             </if>
             <if test="searchText !=null">
-                AND   fre.freeze_no LIKE concat('%',my_ex.likequery(#{searchText}), '%')
+                AND   (fre.freeze_no LIKE concat('%',my_ex.likequery(#{searchText}), '%')
+                or cus.cus_phone LIKE concat('%',my_ex.likequery(#{searchText}), '%')
+                or cus.cus_name LIKE concat('%',my_ex.likequery(#{searchText}), '%'))
             </if>
             <if test="freezeDateSStart != null and freezeDateSEnd != null">
                 AND fre.freeze_date &gt;= #{freezeDateSStart}::timestamp with time zone

+ 4 - 2
src/main/java/com/dk/mdm/mapper/ivt/OutboundMapper.xml

@@ -779,7 +779,8 @@
         makestaff.staff_name                              as "makeStaffName",
         sys.f_get_name_i18n(tdktype.kind_name_i18n, #{i18n}) AS  "outTypeName",
         sys.f_get_name_i18n(tdk.kind_name_i18n, #{i18n}) AS  "outStatusName",
-        tmd.data_value                                   as out_reason_name
+        tmd.data_value                                   as out_reason_name,
+        tpo.address_full as "addressFull"
         from dkic_b.t_psi_outbound tpo
         <include refid="Select_Inbound_Join_Table_Out"/>
         <where>
@@ -841,7 +842,8 @@
         makestaff.staff_name                              as "makeStaffName",
         sys.f_get_name_i18n(tdktype.kind_name_i18n, #{i18n}) AS  "outTypeName",
         sys.f_get_name_i18n(tdk.kind_name_i18n, #{i18n}) AS  "outStatusName",
-        tmd.data_value                                   as out_reason_name
+        tmd.data_value                                   as out_reason_name,
+          '' as "addressFull"
         FROM dkic_b.t_psi_inbound tpi
         <include refid="Select_Inbound_Join_Table_Into"/>
         <where>

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

@@ -62,6 +62,9 @@
             <if test="flgValid != null ">
                 AND t.flg_valid  = #{flgValid}
             </if>
+            <if test="flgDefault != null ">
+                AND t.flg_default  = #{flgDefault}
+            </if>
             <if test="macType != null">
                 AND t.mac_Type  = #{macType} ::uuid
             </if>
@@ -121,7 +124,8 @@
                t.remarks,
                t.flg_valid,
                t.cp_id,
-               coalesce(tmti.amt_trf, 0) as "initBalance"
+               coalesce(tmti.amt_trf, 0) as "initBalance",
+               t.flg_default
         FROM dkic_b.t_mst_money_account as t
                  left join dkic_b.t_mst_dictionary_data as dd on t.mac_type = dd.data_id
                  left join(select tmti.trf_in_mac, tmti.amt_trf

+ 2 - 1
src/main/java/com/dk/mdm/model/pojo/ivt/Transfer.java

@@ -8,6 +8,7 @@ import java.io.Serializable;
 import com.dk.common.infrastructure.annotaiton.ExportTitle;
 import com.dk.common.infrastructure.handler.*;
 import com.dk.common.model.pojo.PageInfo;
+import com.dk.common.model.vo.AnnexVO;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.AllArgsConstructor;
@@ -239,7 +240,7 @@ public class Transfer extends PageInfo<Transfer> implements Serializable {
     @Excel(name = "附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
     @ApiModelProperty(value = "附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
     @TableField(typeHandler = JsonTypeHandler.class)
-    private JSONArray annexPaths;
+    private List<AnnexVO> annexPaths;
     /*
      * 相关属性
      * @TableField(exist = false)

+ 6 - 1
src/main/java/com/dk/mdm/model/pojo/mac/MacTransfer.java

@@ -134,7 +134,12 @@ public class MacTransfer extends PageInfo<MacTransfer> implements Serializable {
     @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
     private Boolean flgValid;
 
-
+    /**
+     * 默认值
+     */
+    @Excel(name = "默认值")
+    @ApiModelProperty(value = "默认值")
+    private Boolean flgDefault;
     /**
      * 企业ID
      */

+ 5 - 0
src/main/java/com/dk/mdm/model/query/ivt/FreezeQuery.java

@@ -75,6 +75,11 @@ public class FreezeQuery extends PageInfo<FreezeQuery> implements Serializable {
     @ApiModelProperty(value = "部门名称")
     @TableField(exist = false)
     private String orgName;
+
+    private List<String> staffIds;
+
+    private List<String> orgIds;
+
     /**
      * 冻结ID
      */

+ 6 - 1
src/main/java/com/dk/mdm/model/query/mac/MacTransferQuery.java

@@ -58,7 +58,12 @@ public class MacTransferQuery extends PageInfo<MacTransferQuery> implements Seri
     @Excel(name = "转账单号")
     @ApiModelProperty(value = "转账单号")
     private String trfNo;
-
+    /**
+     * 默认值
+     */
+    @Excel(name = "默认值")
+    @ApiModelProperty(value = "默认值")
+    private Boolean flgDefault;
     /**
      * 小程序的查询条件
      */

+ 2 - 1
src/main/java/com/dk/mdm/model/vo/ivt/TransferVO.java

@@ -8,6 +8,7 @@ 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;
+import com.dk.common.model.vo.AnnexVO;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -51,7 +52,7 @@ public class TransferVO extends PageInfo<TransferVO> implements Serializable {
     @Excel(name = "附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
     @ApiModelProperty(value = "附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
     @TableField(typeHandler = JsonTypeHandler.class)
-    private JSONArray annexPaths;
+    private List<AnnexVO> annexPaths;
 
     /**
      * 调整单号

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

@@ -7,6 +7,7 @@ import com.dk.common.model.pojo.PageList;
 import com.dk.common.response.ResponseResultUtil;
 import com.dk.common.response.ResponseResultVO;
 import com.dk.mdm.infrastructure.convert.mst.MoneyAccountConvert;
+import com.dk.mdm.infrastructure.util.AuthUtils;
 import com.dk.mdm.mapper.mac.MacTransferItemMapper;
 import com.dk.mdm.mapper.mac.MacTransferMapper;
 import com.dk.mdm.mapper.mst.MoneyAccountItemMapper;
@@ -82,7 +83,8 @@ public class MoneyAccountService extends BaseService<MoneyAccount> {
 	@Autowired
 	private MoneyAccountConvert moneyAccountConvert;
 
-
+    @Autowired
+    private AuthUtils authUtils;
 	/**
 	 * @desc   : 条件查询
 	 * @author : 宋扬
@@ -137,6 +139,19 @@ public class MoneyAccountService extends BaseService<MoneyAccount> {
 		// 获取显示顺序
 		Integer displayNo = commonService.getMaxDisplayNo(Constant.DisplayNoTable.MONEYACCOUNT);
 		moneyAccount.setMacId(codeMap.get("outId").toString()).setMacCode(codeMap.get("outNote").toString()).setDisplayNo(displayNo);
+		if (moneyAccount.getFlgDefault()) { //如果新建的时候 这个设置成默认 那么把默认的 反写false
+			//查询本公司 默认的资金账户
+			List<MoneyAccountResponse> itemList = moneyAccountMapper.selectByCond(new MoneyAccountQuery().setFlgDefault(true).setCpId(authUtils.getStaff().getCpId()).setFlgValid(true));
+			if (itemList.size() > 0) { //说明有 且只有一条
+				MoneyAccountResponse moneyAccountResponse = itemList.get(0); //原先默认的资金账户
+				MoneyAccount moneyAccountDefault = new MoneyAccount();
+				moneyAccountDefault.setFlgDefault(false);
+				moneyAccountDefault.setMacId(moneyAccountResponse.getMacId());
+				//把原先默认的资金账户设置为false
+				super.update(moneyAccountDefault, new UpdateWrapper<MoneyAccount>().lambda().eq(MoneyAccount::getMacId,
+						UUID.fromString(moneyAccountDefault.getMacId())));
+			}
+		}
 		super.insert(moneyAccount);
 
 		// 插入资金转账表
@@ -174,6 +189,19 @@ public class MoneyAccountService extends BaseService<MoneyAccount> {
 	public ResponseResultVO<Boolean> update(MoneyAccountVO moneyAccountVO) {
 		// 转化实体
 		MoneyAccount moneyAccount = moneyAccountConvert.convertToPo(moneyAccountVO);
+        if (moneyAccount.getFlgDefault()) { //如果编辑的时候 这个设置成默认 那么把默认的 反写false
+            //查询本公司 默认的资金账户
+            List<MoneyAccountResponse> itemList = moneyAccountMapper.selectByCond(new MoneyAccountQuery().setFlgDefault(true).setCpId(authUtils.getStaff().getCpId()).setFlgValid(true));
+            if (itemList.size() > 0) { //说明有 且只有一条
+                MoneyAccountResponse moneyAccountResponse = itemList.get(0); //原先默认的资金账户
+                MoneyAccount moneyAccountDefault = new MoneyAccount();
+                moneyAccountDefault.setFlgDefault(false);
+                moneyAccountDefault.setMacId(moneyAccountResponse.getMacId());
+                //把原先默认的资金账户设置为false
+                super.update(moneyAccountDefault, new UpdateWrapper<MoneyAccount>().lambda().eq(MoneyAccount::getMacId,
+                        UUID.fromString(moneyAccountDefault.getMacId())));
+            }
+        }
 			super.update(moneyAccount, new UpdateWrapper<MoneyAccount>().lambda().eq(MoneyAccount::getMacId,
 				UUID.fromString(moneyAccount.getMacId())));