Procházet zdrojové kódy

1、物品申购台账查询调整
2、住宿申请规则调整,审批通过后更新海康数据

dzx před 1 měsícem
rodič
revize
6b323132fe

+ 2 - 2
pom.xml

@@ -572,8 +572,8 @@
                 <artifactId>maven-compiler-plugin</artifactId>
                 <version>3.10.1</version>
                 <configuration>
-                    <source>8</source>
-                    <target>8</target>
+                    <source>11</source>
+                    <target>11</target>
                 </configuration>
             </plugin>
             <!--解开以下注释  打包时 会使用 maven插件 上传到docker-->

+ 7 - 1
src/main/java/com/xjrsoft/module/hikvision/util/DataUtil.java

@@ -13,7 +13,6 @@ import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
 import com.xjrsoft.module.organization.entity.Department;
 import com.xjrsoft.module.personnel.entity.CarMessageApply;
 import lombok.extern.slf4j.Slf4j;
-import lombok.var;
 
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -259,6 +258,10 @@ public class DataUtil {
     }
 
     public Map<String, String> insertStudentOne(String tableName, Map<String, String> tableData, List<HikvisionData> studentList) throws InterruptedException {
+        return insertStudentOne(tableName, tableData, studentList, null);
+    }
+
+    public Map<String, String> insertStudentOne(String tableName, Map<String, String> tableData, List<HikvisionData> studentList, Long userId) throws InterruptedException {
         String sql = "SELECT t1.id,t1.name,CONCAT(t3.id,'-',replace(t4.name,'级',''),'-',t3.class_type,'-',t2.stduy_status) as orgIndexCode," +
                 " t1.user_name,t1.gender,DATE_FORMAT(t1.birth_date, '%Y-%m-%d') as birthday,t1.mobile,t1.email,t1.credential_type,t1.credential_number FROM xjr_user t1" +
                 " INNER JOIN base_student_school_roll t2 ON t1.id = t2.user_id" +
@@ -266,6 +269,9 @@ public class DataUtil {
                 " INNER JOIN base_grade t4 ON t3.grade_id = t4.id" +
                 " WHERE t1.delete_mark = 0 AND t2.delete_mark = 0" +
                 " AND t3.class_type IS NOT NULL AND t3.is_graduate = 1";
+        if(userId != null){
+            sql += " and t1.id = " + userId;
+        }
         List<Map<String, Object>> list = SqlRunnerAdapter.db().selectList(sql, String[].class);
         Map<Integer, String> clientMap = new HashMap<>();
         List<Entity> insertList = new ArrayList<>();

+ 16 - 0
src/main/java/com/xjrsoft/module/liteflow/node/WfRoomApplicantNode.java

@@ -4,6 +4,9 @@ import cn.hutool.core.convert.Convert;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.xjrsoft.common.enums.RoomApplicantTypeEnum;
 import com.xjrsoft.common.enums.StudyStatusEnum;
+import com.xjrsoft.module.hikvision.entity.HikvisionData;
+import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
+import com.xjrsoft.module.hikvision.util.DataUtil;
 import com.xjrsoft.module.room.entity.WfRoomApplicant;
 import com.xjrsoft.module.room.mapper.WfRoomApplicantMapper;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
@@ -12,6 +15,8 @@ import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -23,6 +28,10 @@ public class WfRoomApplicantNode extends NodeComponent {
     private WfRoomApplicantMapper wfRoomApplicantMapper;
     @Autowired
     private IBaseStudentSchoolRollService studentSchoolRollService;
+
+    @Autowired
+    private HikvisionDataMapper hikvisionDataMapper;
+
     @Override
     public void process() throws Exception {
         // 获取表单中数据编号
@@ -43,6 +52,13 @@ public class WfRoomApplicantNode extends NodeComponent {
             }
             //修改学生班级
             studentSchoolRollService.updateById(schoolRoll);
+
+            String tableName = "base_student";
+            List<HikvisionData> studentList = hikvisionDataMapper.selectList(
+                    new QueryWrapper<HikvisionData>().lambda().eq(HikvisionData::getTableName, tableName)
+            );
+            DataUtil dataUtil = new DataUtil();
+            dataUtil.insertStudentOne(tableName, new HashMap<>(), studentList, wfRoomApplicant.getApplicantUserId());
         }
     }
 }

+ 2 - 1
src/main/resources/mapper/ledger/WfSubscriptionMapper.xml

@@ -5,9 +5,10 @@
 <mapper namespace="com.xjrsoft.module.oa.mapper.WfSubscriptionMapper">
     <select id="getPage" parameterType="com.xjrsoft.module.ledger.dto.WfSubscriptionPageDto" resultType="com.xjrsoft.module.ledger.vo.WfSubscriptionPageVo">
         select t1.id,t2.name as org_name,t3.name as user_name,t1.shen_qing_ri_qi4752,t1.folder_id,t1.number,t1.total_amount from wf_subscription t1
+        inner join xjr_workflow_form_relation t4 ON t1.id = t4.form_key_value
         left join xjr_department t2 on t1.application_department = t2.id
         left join xjr_user t3 on t1.user_id = t3.id
-        where t1.status = 1
+        where t4.current_state = 'COMPLETED';
         <if test="dto.orgId != null">
             and t2.id = #{dto.orgId}
         </if>

+ 12 - 9
src/test/java/com/xjrsoft/module/job/HikvisionBaseDataTaskTest.java

@@ -8,9 +8,7 @@ import com.google.gson.JsonElement;
 import com.google.gson.JsonObject;
 import com.google.gson.JsonParser;
 import com.xjrsoft.XjrSoftApplication;
-import com.xjrsoft.common.constant.GlobalConstant;
 import com.xjrsoft.common.mybatis.SqlRunnerAdapter;
-import com.xjrsoft.common.utils.DatasourceUtil;
 import com.xjrsoft.common.utils.SqlRunnerAdapterUtil;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.evaluate.controller.EvaluateItemController;
@@ -20,18 +18,15 @@ import com.xjrsoft.module.hikvision.util.ApiUtil;
 import com.xjrsoft.module.hikvision.util.DataUtil;
 import com.xjrsoft.module.hikvision.util.OutInRecordUtil;
 import com.xjrsoft.module.organization.entity.Department;
-import com.xjrsoft.module.schedule.entity.JianyueData;
 import com.xjrsoft.module.teacher.entity.XjrUser;
 import com.xjrsoft.module.teacher.mapper.FaceImportMapper;
 import com.yomahub.liteflow.util.JsonUtil;
-import lombok.var;
 import org.junit.jupiter.api.Test;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
 
-import javax.sql.DataSource;
 import java.sql.SQLException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -180,7 +175,16 @@ class HikvisionBaseDataTaskTest {
                 new QueryWrapper<HikvisionData>().lambda().eq(HikvisionData::getTableName, tableName)
         );
         Map<String, String> baseStudent = dataMap.get(tableName);
-        Map<String, String> student = insertStudentOne(tableName, baseStudent, studentList);
+        insertStudentOne(tableName, baseStudent, studentList);
+//        sql = "SELECT * FROM wf_room_applicant WHERE delete_mark = 0 AND STATUS = 1";
+//        List<Map<String, Object>> wfRoomApplicantList = SqlRunnerAdapter.db().selectList(sql);
+//
+//        Map<String, String> baseStudent = dataMap.get(tableName);
+//        for (Map<String, Object> objectMap : wfRoomApplicantList) {
+//            Long applicantUserId = Long.parseLong(objectMap.get("applicant_user_id").toString());
+//            Map<String, String> student = dataUtil.insertStudentOne(tableName, baseStudent, studentList, applicantUserId);
+//        }
+
 
 //        selectOrg(use, "base_class");
 
@@ -241,8 +245,7 @@ class HikvisionBaseDataTaskTest {
                 " INNER JOIN base_class t3 ON t2.class_id = t3.id" +
                 " INNER JOIN base_grade t4 ON t3.grade_id = t4.id" +
                 " WHERE t1.delete_mark = 0 AND t2.delete_mark = 0" +
-                " AND t3.class_type IS NOT NULL AND t3.is_graduate = 1" +
-                " AND t3.id = 1828994300931256321";
+                " AND t3.class_type IS NOT NULL AND t3.is_graduate = 1";
         List<Map<String, Object>> list = SqlRunnerAdapter.db().selectList(sql, String[].class);
         Map<Integer, String> clientMap = new HashMap<>();
         List<Entity> insertList = new ArrayList<>();
@@ -292,7 +295,7 @@ class HikvisionBaseDataTaskTest {
             paramJson.addProperty("gender", gender);
 
             if(historyMap.containsKey(id)){
-                if(!paramJson.toString().equals(historyMap.get(id))){
+                if(historyMap.get(id) ==null || !paramJson.toString().equals(historyMap.get(id))){
                     updateList.add(paramJson);
                 }
                 continue;