From 77d0006d03513343e40108735540387e8f188ce4 Mon Sep 17 00:00:00 2001
From: xiejun <xj@2023>
Date: 星期四, 14 十二月 2023 17:08:34 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java               |    5 
 Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue                                                         |  129 +++++++-----
 Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/StatisticConfigServiceImpl.java |  104 ++++++++++
 Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue                                                |    2 
 Source/UBCS/service-systemctl-restart.sh                                                                            |   24 ++
 Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/StatisticConfigMapper.java            |   12 +
 Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/toolmodel/DateConverter.java      |    5 
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmEngineService.java                    |    1 
 /dev/null                                                                                                           |  108 ----------
 Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/StatisticConfigVO.java            |   16 +
 Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IStatisticConfigService.java         |   36 +++
 Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/StatisticConfigMapper.xml                            |    7 
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java           |    6 
 Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/StatisticConfigController.java    |   58 +++++
 Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/StatisticConfig.java          |   66 ++++++
 15 files changed, 407 insertions(+), 172 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue b/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
index 76fc6c0..82d1ebe 100644
--- a/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
+++ b/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
@@ -46,15 +46,15 @@
                 <el-table-column v-if="tableData.length != 0" fixed label="搴忓彿" type="index" width="55">
                 </el-table-column>
                 <!--              鐢熷懡鍛ㄦ湡-->
-<!--                <el-table-column v-for="(item,index) in lcstatusArray"-->
-<!--                                 v-if=" lcstatusArray.length >= 0 && !item.hidden"-->
-<!--                                 key="index" :show-overflow-tooltip="true" :sortable="item.sortable"-->
-<!--                                 :width="item.width" align="center" label="鐢熷懡鍛ㄦ湡鍊�"-->
-<!--                                 prop="lcstatus">-->
-<!--                  <template slot-scope="scope">-->
-<!--                    <span>{{ scope.row.lcstatus_text }}</span>-->
-<!--                  </template>-->
-<!--                </el-table-column>-->
+                <!--                <el-table-column v-for="(item,index) in lcstatusArray"-->
+                <!--                                 v-if=" lcstatusArray.length >= 0 && !item.hidden"-->
+                <!--                                 key="index" :show-overflow-tooltip="true" :sortable="item.sortable"-->
+                <!--                                 :width="item.width" align="center" label="鐢熷懡鍛ㄦ湡鍊�"-->
+                <!--                                 prop="lcstatus">-->
+                <!--                  <template slot-scope="scope">-->
+                <!--                    <span>{{ scope.row.lcstatus_text }}</span>-->
+                <!--                  </template>-->
+                <!--                </el-table-column>-->
                 <!--              缂栧彿-->
                 <el-table-column v-for="(item, index) in CodeArray" v-if="CodeArray.length !== 0 && !item.hidden"
                                  key="index" :label="item.label" :prop="item.prop"
@@ -345,7 +345,7 @@
       },
       // 涓绘暟鎹寜閽�
       masterVrBtnList: [],
-      fileOptions:{},
+      fileOptions: {},
       result: '',
       elapsedTime: '',
     };
@@ -397,7 +397,7 @@
         this.tableData = newval;
         this.searchResults = newval
         this.doLayout();
-        this.fileOptions= {
+        this.fileOptions = {
           ownbizOid: "0",
           ownbizBtm: "0",
           fileDocClassify: '!=processAuditSuggest',
@@ -467,6 +467,7 @@
     templateOid: {
       handler(newval, oldval) {
         this.fileOptions.ownbizOid = "0";
+        this.statusSelect = 'all'
       },
       deep: true,
     },
@@ -590,7 +591,7 @@
         func.downloadFileByBlobHandler(res);
         this.$message.success('涓嬭浇鎴愬姛锛岃鏌ョ湅锛�');
         this.isLoading = false;
-      }).catch(error=>{
+      }).catch(error => {
         this.$message.error(error);
       });
     },
@@ -927,40 +928,46 @@
       })
     },
     // 鎺掑簭
-    sortChange(val) {
-      // console.log(val)
-      this.isLoading = true;
-      let order = "";
-      if (val.order == "ascending") {
-        order = "asc";
-      } else {
-        order = "desc";
+    async sortChange(val) {
+      try {
+        this.isLoading = true;
+        const order = val.order == 'ascending' ? 'asc' : 'desc';
+        const {data} = await TableData({
+          templateOid: this.templateOid,
+          codeClassifyOid: this.codeClassifyOid,
+          order: order,
+          sort: val.prop,
+          page: this.page.currentPage,
+          limit: this.page.pageSize,
+        });
+        this.data = data.data;
+      } finally {
+        this.isLoading = false;
       }
-      TableData({
-        templateOid: this.templateOid,
-        codeClassifyOid: this.codeClassifyOid,
-        order: order,
-        sort: val.prop,
-        page: this.page.currentPage,
-        limit: this.page.pageSize,
-      }).then((res) => {
-        setTimeout(() => {
-          this.data = res.data.data;
-          this.isLoading = false;
-        }, 100);
-      });
     },
     //鍒嗛〉鍒锋柊
     async onLoad(val) {
-      await TableData({
-        templateOid: this.templateOid,
-        codeClassifyOid: this.codeClassifyOid,
-        page: this.page.currentPage,
-        limit: this.page.pageSize,
-      }).then((res) => {
+      this.isLoading = true;
+
+      try {
+        let conditionMap = {};
+        if (this.statusSelect !== 'all') {
+          conditionMap.lcstatus = this.statusSelect;
+        }
+        const res = await TableData({
+          templateOid: this.templateOid,
+          codeClassifyOid: this.codeClassifyOid,
+          page: this.page.currentPage,
+          limit: this.page.pageSize,
+          conditionMap
+        });
         this.tableData = res.data.data;
-        this.doLayout()
-      });
+        this.doLayout();
+      } catch (error) {
+        this.$message.error(error)
+      } finally {
+        this.isLoading = false;
+      }
     },
     //澶氶��
     handleSelectionChange(list) {
@@ -993,15 +1000,18 @@
       this.findvisible = true;
     },
     // 楂樼骇鏌ヨ
-    echoContion(val) {
-      FindData({
-        templateOid: this.templateOid,
-        codeClassifyOid: this.codeClassifyOid,
-        ...val,
-      }).then((res) => {
+    async echoContion(val) {
+      try {
+        const res = await FindData({
+          templateOid: this.templateOid,
+          codeClassifyOid: this.codeClassifyOid,
+          ...val,
+        });
         this.tableData = res.data.data;
         this.page.total = res.data.total
-      });
+      } catch (error) {
+
+      }
     },
     //鐩镐技椤规煡璇�
     similarHandler() {
@@ -1071,17 +1081,20 @@
     //杈撳叆鍥炶溅鎼滅储
     tableFindInp() {
       this.isLoading = true;
-      TableData({
-        templateOid: this.templateOid,
-        codeClassifyOid: this.codeClassifyOid,
-        page: this.page.currentPage,
-        limit: this.page.pageSize,
-        ['conditionMap[' + this.keyWordFind + ']']: '*' + this.WupinFindValue + '*'
-      }).then(res => {
-        this.tableData = res.data.data;
-        this.page.total = res.data.total;
+      try {
+        TableData({
+          templateOid: this.templateOid,
+          codeClassifyOid: this.codeClassifyOid,
+          page: this.page.currentPage,
+          limit: this.page.pageSize,
+          ['conditionMap[' + this.keyWordFind + ']']: '*' + this.WupinFindValue + '*'
+        }).then(res => {
+          this.tableData = res.data.data;
+          this.page.total = res.data.total;
+        })
+      } finally {
         this.isLoading = false;
-      })
+      }
     }
 
   }
diff --git a/Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue b/Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue
index 0e5a2de..3824b23 100644
--- a/Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue
+++ b/Source/UBCS-WEB/src/components/StatisticsComponent/ColumnarChart.vue
@@ -92,7 +92,7 @@
   data() {
     return {
       chartOptions: {
-        color:["#91CC75", "#5470C6"],
+        color:['#84C9E5', '#F68686'],
         title: {
           text: "",
         },
diff --git a/Source/UBCS/service-systemctl-restart.sh b/Source/UBCS/service-systemctl-restart.sh
index dd610e8..8993e66 100644
--- a/Source/UBCS/service-systemctl-restart.sh
+++ b/Source/UBCS/service-systemctl-restart.sh
@@ -18,61 +18,85 @@
 systemctl restart ubcs-admin.service
 echo '---------------ubcs-admin 鏈嶅姟閲嶅惎鍛戒护鎵ц瀹屾瘯------------------'
 
+sleep 3
+
 echo '--------------ubcs-applyjtcodeservice 鏈嶅姟姝e湪閲嶅惎------------'
 yes | cp -f ./target/ubcs-applyjtcodeservice.jar /data1/ubcs/ubcs-server/ubcs_applyjtcodeservice/
 systemctl restart ubcs-applyjtcodeservice.service
 echo '----------ubcs-applyjtcodeservice 鏈嶅姟閲嶅惎鍛戒护鎵ц瀹屾瘯----------'
+
+sleep 3
 
 echo '-------------------ubcs-auth 鏈嶅姟姝e湪閲嶅惎------------------ --'
 yes | cp -f ./target/ubcs-auth.jar /data1/ubcs/ubcs-server/ubcs_auth/
 systemctl restart ubcs-auth.service
 echo '---------------ubcs-auth 鏈嶅姟閲嶅惎鍛戒护鎵ц瀹屾瘯-------------------'
 
+sleep 3
+
 echo '-------------------ubcs-code 鏈嶅姟姝e湪閲嶅惎---------------------'
 yes | cp -f ./target/ubcs-code.jar /data1/ubcs/ubcs-server/ubcs_code/
 systemctl restart ubcs-code.service
 echo '---------------ubcs-code 鏈嶅姟閲嶅惎鍛戒护鎵ц瀹屾瘯-------------------'
+
+sleep 3
 
 echo '-------------------ubcs-desk 鏈嶅姟姝e湪閲嶅惎---------------------'
 yes | cp -f ./target/ubcs-desk.jar /data1/ubcs/ubcs-server/ubcs_desk/
 systemctl restart ubcs-desk.service
 echo '---------------ubcs-desk 鏈嶅姟閲嶅惎鍛戒护鎵ц瀹屾瘯-------------------'
 
+sleep 3
+
 echo '-------------------ubcs-flow 鏈嶅姟姝e湪閲嶅惎--------------------'
 yes | cp -f ./target/ubcs-flow.jar /data1/ubcs/ubcs-server/ubcs_flow/
 systemctl restart ubcs-flow.service
 echo '---------------ubcs-flow 鏈嶅姟閲嶅惎鍛戒护鎵ц瀹屾瘯------------------'
+
+sleep 3
 
 echo '-------------------ubcs-gateway 鏈嶅姟姝e湪閲嶅惎-----------------'
 yes | cp -f ./target/ubcs-gateway.jar /data1/ubcs/ubcs-server/ubcs_gateway/
 systemctl restart ubcs-gateway.service
 echo '---------------ubcs-gateway 鏈嶅姟閲嶅惎鍛戒护鎵ц瀹屾瘯---------------'
 
+sleep 3
+
 echo '-------------------ubcs-log 鏈嶅姟姝e湪閲嶅惎---------------------'
 yes | cp -f ./target/ubcs-log.jar /data1/ubcs/ubcs-server/ubcs_log/
 systemctl restart ubcs-log.service
 echo '---------------ubcs-log 鏈嶅姟閲嶅惎鍛戒护鎵ц瀹屾瘯-------------------'
+
+sleep 3
 
 echo '-------------------ubcs-omd 鏈嶅姟姝e湪閲嶅惎---------------------'
 yes | cp -f ./target/ubcs-omd.jar /data1/ubcs/ubcs-server/ubcs_omd/
 systemctl restart ubcs-omd.service
 echo '---------------ubcs-omd 鏈嶅姟閲嶅惎鍛戒护鎵ц瀹屾瘯-------------------'
 
+sleep 3
+
 echo '-------------------ubcs-report 鏈嶅姟姝e湪閲嶅惎-------------------'
 yes | cp -f ./target/ubcs-report.jar /data1/ubcs/ubcs-server/ubcs_report/
 systemctl restart ubcs-report.service
 echo '---------------ubcs-report 鏈嶅姟閲嶅惎鍛戒护鎵ц瀹屾瘯-----------------'
+
+sleep 3
 
 echo '-------------------ubcs-resource 鏈嶅姟姝e湪閲嶅惎------------------'
 yes | cp -f ./target/ubcs-resource.jar /data1/ubcs/ubcs-server/ubcs_resource/
 systemctl restart ubcs-resource.service
 echo '---------------ubcs-resource 鏈嶅姟閲嶅惎鍛戒护鎵ц瀹屾瘯----------------'
 
+sleep 3
+
 echo '-------------------ubcs-system 鏈嶅姟姝e湪閲嶅惎---------------------'
 yes | cp -f ./target/ubcs-system.jar /data1/ubcs/ubcs-server/ubcs_system/
 systemctl restart ubcs-system.service
 echo '---------------ubcs-system 鏈嶅姟閲嶅惎鍛戒护鎵ц瀹屾瘯-------------------'
 
+sleep 3
+
 echo '--------------------ubcs-user 鏈嶅姟姝e湪閲嶅惎----------------------'
 yes | cp -f ./target/ubcs-user.jar /data1/ubcs/ubcs-server/ubcs_user/
 systemctl restart ubcs-user.service
diff --git a/Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/StatisticConfig.java b/Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/StatisticConfig.java
new file mode 100644
index 0000000..f20aa9c
--- /dev/null
+++ b/Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/StatisticConfig.java
@@ -0,0 +1,66 @@
+package com.vci.ubcs.system.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 涓绘暟鎹粺璁″璞�
+ * @author yuxc
+ * @date 2023/12/13 11:13
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName("PL_SYS_STATISTIC_CONFIG")
+public class StatisticConfig implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 涓婚敭
+	 */
+	@TableId
+	private Long id;
+
+	/**
+	 * 鐢ㄦ埛id
+	 */
+	private Long  userId;
+
+	/**
+	 * 涓氬姟绫诲瀷
+	 */
+	private String btmname;
+
+	/**
+	 * 鍥惧舰ids
+	 */
+	private String chartIds;
+
+	/**
+	 * 鍒涘缓鏃堕棿
+	 */
+	private Date createtime;
+	/**
+	 * 鍒涘缓浜�
+	 */
+	private String creator;
+	/**
+	 * 淇敼鏃堕棿
+	 */
+	private Date lastmodifytime;
+	/**
+	 * 淇敼浜�
+	 */
+	private String lastmodifier;
+	/**
+	 *
+	 */
+	private Date ts;
+}
diff --git a/Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/StatisticConfigVO.java b/Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/StatisticConfigVO.java
new file mode 100644
index 0000000..36ee16b
--- /dev/null
+++ b/Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/StatisticConfigVO.java
@@ -0,0 +1,16 @@
+package com.vci.ubcs.system.vo;
+
+import com.vci.ubcs.system.entity.MdmCountConfig;
+import com.vci.ubcs.system.entity.StatisticConfig;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author ludc
+ * @date 2023/10/18 8:56
+ */
+@Data
+public class StatisticConfigVO extends StatisticConfig {
+
+}
diff --git a/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/toolmodel/DateConverter.java b/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/toolmodel/DateConverter.java
index 9e280ef..1f98cc3 100644
--- a/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/toolmodel/DateConverter.java
+++ b/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/toolmodel/DateConverter.java
@@ -140,7 +140,7 @@
 		return text.substring(0, text.lastIndexOf(".")) + "." + nano;
 	}
 
-	public static void main(String[] args) {
+	/*public static void main(String[] args) {
 		List<String> list = new ArrayList<String>() {
 			{
 				this.add("2020-11-12 12:12:03");
@@ -175,7 +175,7 @@
 			}
 
 		});
-	}
+	}*/
 
 	public String getAsText(String dateFormat) {
 		Date value = this.getValue();
@@ -185,4 +185,5 @@
 
 		return value != null ? (new SimpleDateFormat(dateFormat)).format(value) : "";
 	}
+
 }
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmEngineService.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmEngineService.java
index 418809c..077354c 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmEngineService.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmEngineService.java
@@ -245,7 +245,6 @@
 	 */
 	R batchUpdateCode(List<CodeOrderDTO> orderDTOList);
 
-
 	/**
 	 * 鏍囪娴佺▼涓笟鍔℃暟鎹槸鍚﹂�氳繃
 	 * @param oid 涓氬姟鏁版嵁涓婚敭
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
index 3bb6a3e..d744a7a 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
@@ -88,6 +88,8 @@
 import java.beans.PropertyDescriptor;
 import java.lang.reflect.Method;
 import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.time.LocalDateTime;
 import java.time.ZoneId;
 import java.time.ZonedDateTime;
@@ -4196,7 +4198,7 @@
         bo.setFirstV("1");
         bo.setLastV("1");
         bo.setRevisionRule(listR.getData().get(0).getRevisionRuleId());
-        bo.setVersionRule("".equals(listR.getData().get(0).getVersionRule())?"0":listR.getData().get(0).getVersionRule());
+        bo.setVersionRule("".equals(listR.getData().get(0).getVersionRule())?"1":listR.getData().get(0).getVersionRule());
         if (StringUtils.isNotBlank(listR.getData().get(0).getRevisionRuleId())) {
             R<List<RevisionRuleVO>> revisionRuleVO = revisionRuleClient
                     .selectByIdCollection(Collections.singletonList(listR.getData().get(0).getRevisionRuleId().toLowerCase()));
@@ -4217,7 +4219,7 @@
         bo.setId("");
         bo.setName("");
         bo.setDescription("");
-        bo.setOwner("1");
+        bo.setOwner(AuthUtil.getUser().getUserId().toString());
 //		bo.setCheckinby(userName);
         bo.setCopyFromVersion("");
 //		this.initTypeAttributeValue(bo,btmTypeVO);
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
index 973d396..93f901d 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
@@ -3614,6 +3614,11 @@
 		rowDataList.stream().forEach(rowData -> {
 			ClientBusinessObject cbo=new ClientBusinessObject();
 			DefaultAttrAssimtUtil.addDefaultAttrAssimt(cbo, classifyFullInfo.getTopClassifyVO().getBtmTypeId());
+			R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(classifyFullInfo.getTopClassifyVO().getBtmTypeId()));
+			if(!listR.isSuccess() || listR.getData().size() == 0){
+				throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
+			}
+			cbo.setRevisionRule("".equals(listR.getData().get(0).getVersionRule())?"1":listR.getData().get(0).getVersionRule());
 			rowData.getData().forEach((index,value)->{
 					String field = fieldIndexMap.get(index);
 				if (StringUtils.isBlank(field)) {
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeWupinMapper.xml b/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeWupinMapper.xml
deleted file mode 100644
index 124812f..0000000
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeWupinMapper.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.vci.ubcs.code.mapper.CodeWupinMapper">
-
-    <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
-    <resultMap id="codeWupinResultMap" type="com.vci.ubcs.code.entity.CodeWupin">
-        <result column="OID" property="oid"/>
-        <result column="REVISIONOID" property="revisionOid"/>
-        <result column="NAMEOID" property="nameOid"/>
-        <result column="BTMNAME" property="btmname"/>
-        <result column="LASTR" property="lastR"/>
-        <result column="FIRSTR" property="firstR"/>
-        <result column="LASTV" property="lastV"/>
-        <result column="FIRSTV" property="firstV"/>
-        <result column="CREATOR" property="creator"/>
-        <result column="CREATETIME" property="createTime"/>
-        <result column="LASTMODIFIER" property="lastModifier"/>
-        <result column="LASTMODIFYTIME" property="lastModifyTime"/>
-        <result column="REVISIONRULE" property="revisionRule"/>
-        <result column="VERSIONRULE" property="versionRule"/>
-        <result column="REVISIONSEQ" property="revisionSeq"/>
-        <result column="REVISIONVALUE" property="revisionValue"/>
-        <result column="VERSIONSEQ" property="versionSeq"/>
-        <result column="VERSIONVALUE" property="versionValue"/>
-        <result column="LCTID" property="lctid"/>
-        <result column="LCSTATUS" property="lcStatus"/>
-        <result column="TS" property="ts"/>
-        <result column="ID" property="id"/>
-        <result column="NAME" property="name"/>
-        <result column="DESCRIPTION" property="description"/>
-        <result column="OWNER" property="owner"/>
-        <result column="CHECKINBY" property="checkinby"/>
-        <result column="CHECKINTIME" property="checkintime"/>
-        <result column="CHECKOUTBY" property="checkoutby"/>
-        <result column="CHECKOUTTIME" property="checkouttime"/>
-        <result column="COPYFROMVERSION" property="copyFromVersion"/>
-        <result column="CODECLSFID" property="codeclsfid"/>
-        <result column="CODECLSFPATH" property="codeclsfpath"/>
-        <result column="CODETEMPLATEOID" property="codetemplateoid"/>
-        <result column="MATERIALCLASSIFY" property="materialclassify"/>
-        <result column="MATERIALID" property="materialid"/>
-        <result column="TUHAO" property="tuhao"/>
-        <result column="PINPAI" property="pinpai"/>
-        <result column="MORENGONGYS" property="morengongys"/>
-        <result column="XIEYIJIAGE" property="xieyijiage"/>
-        <result column="HESUANPICI" property="hesuanpici"/>
-        <result column="BEIZHUSHUOMING" property="beizhushuoming"/>
-        <result column="MATERIALTYPE" property="materialtype"/>
-        <result column="MATERIALNAME" property="materialname"/>
-        <result column="RUANJIANBANBEN" property="ruanjianbanben"/>
-        <result column="QITACHICUN" property="qitachicun"/>
-        <result column="MORENCAIGOUY" property="morencaigouy"/>
-        <result column="YUMAILEIXING" property="yumaileixing"/>
-        <result column="CHUANGJIANGONGSI" property="chuangjiangongsi"/>
-        <result column="CAIGOUWL" property="caigouwl"/>
-        <result column="WULIAOXINGZHI" property="wuliaoxingzhi"/>
-        <result column="XIEYIBIANHAO" property="xieyibianhao"/>
-        <result column="CAIZHI" property="caizhi"/>
-        <result column="CHUKUFANGSHI" property="chukufangshi"/>
-        <result column="SHIFOUPIHAOGUANLI" property="shifoupihaoguanli"/>
-        <result column="KUCUNWL" property="kucunwl"/>
-        <result column="XINGHAOGUIGE" property="xinghaoguige"/>
-        <result column="DUIWAIGUIGE" property="duiwaiguige"/>
-        <result column="ZHIBAOQI" property="zhibaoqi"/>
-        <result column="CAIGOUTIQIANQI" property="caigoutiqianqi"/>
-        <result column="HESUANFENLEI" property="hesuanfenlei"/>
-        <result column="XIAOSHOUWL" property="xiaoshouwl"/>
-        <result column="CHANGJIAXINGHAO" property="changjiaxinghao"/>
-        <result column="ZUIXIAOQIDING" property="zuixiaoqiding"/>
-        <result column="JILIANGDW" property="jiliangdw"/>
-        <result column="ZHILIANGBZ" property="zhiliangbz"/>
-        <result column="FIRSTFL" property="firstfl"/>
-        <result column="SECONDFL" property="secondfl"/>
-        <result column="THRIFL" property="thrifl"/>
-        <result column="OLDCODE" property="oldcode"/>
-        <result column="SECRETGRADE" property="secretGrade"/>
-        <result column="BAOZHUANGGUIGE" property="baozhuangguige"/>
-        <result column="PASSING" property="passing"/>
-        <result column="XBJ" property="xbj"/>
-        <result column="XBXKXS" property="xbxkxs"/>
-        <result column="XFJJSTJ" property="xfjjstj"/>
-        <result column="XGZCCDGCD" property="xgzccdgcd"/>
-        <result column="XXNDJ" property="xxndj"/>
-        <result column="XZJMC" property="xzjmc"/>
-        <result column="ZJXH" property="zjxh"/>
-        <result column="CLPH" property="clph"/>
-        <result column="BMCL" property="bmcl"/>
-        <result column="CPXS" property="cpxs"/>
-        <result column="XBZJBMC" property="xbzjbmc"/>
-        <result column="XWLWWMC" property="xwlwwmc"/>
-        <result column="JJZYQ" property="jjzyq"/>
-        <result column="JSBMC" property="jsbmc"/>
-        <result column="JSBXH" property="jsbxh"/>
-        <result column="JSCCJ" property="jsccj"/>
-        <result column="JSSXT" property="jssxt"/>
-        <result column="JSZGL" property="jszgl"/>
-        <result column="JZL" property="jzl"/>
-        <result column="JZRXX" property="jzrxx"/>
-        <result column="JZXZB" property="jzxzb"/>
-    </resultMap>
-
-
-    <select id="selectCodeWupinPage" resultMap="codeWupinResultMap">
-        select * from PL_CODE_WUPIN where is_deleted = 0
-    </select>
-
-
-</mapper>
diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/StatisticConfigController.java b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/StatisticConfigController.java
new file mode 100644
index 0000000..a4d1453
--- /dev/null
+++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/StatisticConfigController.java
@@ -0,0 +1,58 @@
+package com.vci.ubcs.system.controller;
+
+import com.vci.ubcs.system.entity.StatisticConfig;
+import com.vci.ubcs.system.service.IMdmCountConfigService;
+import com.vci.ubcs.system.service.IStatisticConfigService;
+import com.vci.ubcs.system.vo.MdmCountConfigVO;
+import io.swagger.annotations.Api;
+import lombok.AllArgsConstructor;
+import org.springblade.core.tenant.annotation.NonDS;
+import org.springblade.core.tool.api.R;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @author yuxc
+ * @date 2023/12/13 15:47
+ */
+@NonDS
+@RestController
+@AllArgsConstructor
+@RequestMapping("/statisticConfig")
+//@Api(value = "瀛楀吀", tags = "瀛楀吀")
+public class StatisticConfigController {
+
+	private final IStatisticConfigService statisticConfigService;
+
+	/**
+     * 缁熻鍒嗘瀽淇濆瓨
+	 * @param statisticConfigs 鏁版嵁浼犺緭瀵硅薄
+	 * @return 鏁版嵁杩斿洖
+	 */
+	@PostMapping("/saveStatisticAnalysis")
+	public R saveStatisticAnalysis(@RequestBody List<StatisticConfig> statisticConfigs){
+		return statisticConfigService.saveStatisticConfig(statisticConfigs);
+	}
+
+	/**
+	 * 缁熻鍒嗘瀽鍒犻櫎鍥惧舰
+	 * @param btmname 涓氬姟绫诲瀷
+	 * @param chartId 鍥惧舰ID
+	 * @return 鎴愬姛涓庡惁
+	 */
+	@PostMapping("/deleteChartId")
+	public R deleteChartId(String btmname,String chartId){
+		return statisticConfigService.deleteChartId(btmname,chartId);
+	}
+
+	/**
+	 * 鑾峰彇鐢ㄦ埛閰嶇疆鐨勪笟鍔$被鍨嬩笌鐩稿叧鐨勫浘褰�
+	 * @return 鍥惧舰鏁版嵁涓庝笟鍔$被鍨婭D
+	 */
+	@GetMapping("/getBtmAndChartIds")
+	public R getBtmAndChartIds(){
+		return statisticConfigService.getBtmAndChartIds();
+	}
+
+}
diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/StatisticConfigMapper.java b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/StatisticConfigMapper.java
new file mode 100644
index 0000000..01fdf6c
--- /dev/null
+++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/StatisticConfigMapper.java
@@ -0,0 +1,12 @@
+package com.vci.ubcs.system.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.vci.ubcs.system.entity.StatisticConfig;
+
+/**
+ * @author ludc
+ * @date 2023/10/17 14:53
+ */
+public interface StatisticConfigMapper extends BaseMapper<StatisticConfig> {
+
+}
diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IStatisticConfigService.java b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IStatisticConfigService.java
new file mode 100644
index 0000000..352f766
--- /dev/null
+++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IStatisticConfigService.java
@@ -0,0 +1,36 @@
+package com.vci.ubcs.system.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.vci.ubcs.system.entity.StatisticConfig;
+import org.springblade.core.tool.api.R;
+
+import java.util.List;
+
+/**
+ * 涓绘暟鎹粺璁¢椤甸厤缃湇鍔�
+ * @author ludc
+ * @date 2023/10/17 14:44
+ */
+public interface IStatisticConfigService extends IService<StatisticConfig> {
+
+	/**
+	 * 缁熻鍒嗘瀽淇濆瓨
+	 * @param statisticConfigs 鏁版嵁浼犺緭瀵硅薄
+	 * @return 鏁版嵁杩斿洖
+	 */
+	R saveStatisticConfig(List<StatisticConfig> statisticConfigs);
+
+	/**
+	 * 缁熻鍒嗘瀽鍒犻櫎鍥惧舰
+	 * @param btmname 涓氬姟绫诲瀷
+	 * @param chartId 鍥惧舰ID
+	 * @return 鎴愬姛涓庡惁
+	 */
+    R deleteChartId(String btmname, String chartId);
+
+	/**
+	 * 鑾峰彇鐢ㄦ埛閰嶇疆鐨勪笟鍔$被鍨嬩笌鐩稿叧鐨勫浘褰�
+	 * @return 鍥惧舰鏁版嵁涓庝笟鍔$被鍨婭D
+	 */
+	R getBtmAndChartIds();
+}
diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/StatisticConfigServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/StatisticConfigServiceImpl.java
new file mode 100644
index 0000000..1168900
--- /dev/null
+++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/StatisticConfigServiceImpl.java
@@ -0,0 +1,104 @@
+package com.vci.ubcs.system.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.vci.ubcs.system.entity.MdmCountConfig;
+import com.vci.ubcs.system.entity.StatisticConfig;
+import com.vci.ubcs.system.mapper.MdmCountConfigMapper;
+import com.vci.ubcs.system.mapper.StatisticConfigMapper;
+import com.vci.ubcs.system.service.IMdmCountConfigService;
+import com.vci.ubcs.system.service.IStatisticConfigService;
+import com.vci.ubcs.system.vo.MdmCountConfigVO;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.StringUtil;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * 涓绘暟鎹粺璁¢椤甸厤缃湇鍔�
+ * @author ludc
+ * @date 2023/10/17 14:45
+ */
+@Service
+public class StatisticConfigServiceImpl extends ServiceImpl<StatisticConfigMapper, StatisticConfig> implements IStatisticConfigService {
+	/**
+	 * 缁熻鍒嗘瀽淇濆瓨
+	 * @param statisticConfigs 鏁版嵁浼犺緭瀵硅薄
+	 * @return 鏁版嵁杩斿洖
+	 */
+	@Override
+	public R saveStatisticConfig(List<StatisticConfig> statisticConfigs) {
+
+		QueryWrapper<StatisticConfig> wrapper = new QueryWrapper<>();
+		wrapper.eq("user_id", AuthUtil.getUser().getUserId());
+		wrapper.in("btmname", statisticConfigs.stream().map(StatisticConfig::getBtmname).collect(Collectors.toList()));
+		List<StatisticConfig> list = this.list(wrapper);
+		statisticConfigs.stream().map(e ->{
+			list.stream().filter(lis -> e.getBtmname().equals(lis.getBtmname())).forEach(lis->{
+					e.setId(lis.getId());
+					e.setTs(new Date());
+					e.setCreator(lis.getCreator());
+					e.setCreatetime(lis.getCreatetime());
+					e.setLastmodifier(String.valueOf(AuthUtil.getUser().getUserId()));
+					e.setLastmodifytime(new Date());
+			});
+			if(e.getId() == null){
+				e.setUserId(AuthUtil.getUser().getUserId());
+				e.setTs(new Date());
+				e.setCreator(String.valueOf(AuthUtil.getUser().getUserId()));
+				e.setCreatetime(new Date());
+				e.setLastmodifier(String.valueOf(AuthUtil.getUser().getUserId()));
+				e.setLastmodifytime(new Date());
+			}
+			return e;
+		}).collect(Collectors.toList());
+
+		this.saveOrUpdateBatch(statisticConfigs);
+
+		return R.success("鎿嶄綔鎴愬姛锛�");
+	}
+
+	/**
+	 * 缁熻鍒嗘瀽鍒犻櫎鍥惧舰
+	 * @param btmname 涓氬姟绫诲瀷
+	 * @param chartId 鍥惧舰ID
+	 * @return 鎴愬姛涓庡惁
+	 */
+	@Override
+	public R deleteChartId(String btmname, String chartId) {
+
+		QueryWrapper<StatisticConfig> wrapper = new QueryWrapper<>();
+		wrapper.eq("user_id", AuthUtil.getUser().getUserId());
+		wrapper.in("btmname",btmname);
+		StatisticConfig statisticConfig = this.getOne(wrapper);
+		if(StringUtil.isBlank(statisticConfig.getChartIds())){
+			throw new ServiceException("鏈煡鍒板巻鍙茬浉鍏冲浘褰㈡暟鎹紝璇峰厛淇濆瓨锛侊紒");
+		}
+		List<String> chartIds = new ArrayList(Arrays.asList(statisticConfig.getChartIds().split(",")));
+		chartIds.remove(chartId);
+		statisticConfig.setChartIds(chartIds.stream().collect(Collectors.joining(",")));
+		this.updateById(statisticConfig);
+		return R.success("鎿嶄綔鎴愬姛锛侊紒");
+	}
+
+	/**
+	 * 鑾峰彇鐢ㄦ埛閰嶇疆鐨勪笟鍔$被鍨嬩笌鐩稿叧鐨勫浘褰�
+	 * @return 鍥惧舰鏁版嵁涓庝笟鍔$被鍨婭D
+	 */
+	@Override
+	public R getBtmAndChartIds() {
+		QueryWrapper<StatisticConfig> wrapper = new QueryWrapper<>();
+		wrapper.eq("user_id", AuthUtil.getUser().getUserId());
+		List<StatisticConfig> list = this.list(wrapper);
+		Map<String, String> collect = list.stream().collect(Collectors.toMap(StatisticConfig::getBtmname, StatisticConfig::getChartIds));
+		return R.data(collect);
+	}
+
+}
diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/StatisticConfigMapper.xml b/Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/StatisticConfigMapper.xml
new file mode 100644
index 0000000..384de10
--- /dev/null
+++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/StatisticConfigMapper.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.vci.ubcs.system.mapper.StatisticConfigMapper">
+
+
+
+</mapper>

--
Gitblit v1.9.3