hanfucheng 1 éve
szülő
commit
77e82436a1

+ 10 - 10
data-ui/src/views/data/generalbusiness/keyProjects/index.vue

@@ -766,15 +766,15 @@ export default {
         projectName: [
           {required: true, message: "项目名称不能为空", trigger: "blur"}
         ],
-        territoriality: [
+       /* territoriality: [
           {required: true, message: "属地辖区不能为空", trigger: ["blur", "change"]}
-        ],
-        principal: [
+        ],*/
+        /*principal: [
           {required: true, message: "负责人不能为空", trigger: "blur"}
-        ],
-        constructionSite: [
+        ],*/
+        /*constructionSite: [
           {required: true, message: "建设地点不能为空", trigger: "blur"}
-        ],
+        ],*/
         nature: [
           {required: true, message: "在建性质不能为空", trigger: "blur"}
         ],
@@ -798,14 +798,14 @@ export default {
         parkLatitude: [
           {validator: checkLat, trigger: ["blur", "change"]}
         ],
-        introduction: [
-          {required: true, message: "建设内容不能为空", trigger: "blur"}
-        ],
+        // introduction: [
+        //   {required: true, message: "建设内容不能为空", trigger: "blur"}
+        // ],
         cameraSystem: [
           {required: true, message: "所属分类不能为空", trigger: "change"}
         ],
         phone: [
-          {required: true, message: "联系电话不能为空", trigger: "blur"},
+          // {required: true, message: "联系电话不能为空", trigger: "blur"},
           {validator: validPhoneMobile, trigger: 'blur'}
         ],
         totalInvest: [

+ 1 - 3
src/main/java/com/sooka/sponest/data/generalbusiness/controller/CenterdataTKeyProjectsController.java

@@ -171,9 +171,7 @@ public class CenterdataTKeyProjectsController extends BaseController {
     public AjaxResult receivedMessage(@RequestBody List<CenterdataTKeyProjects> centerdataTKeyProjects) {
         for (CenterdataTKeyProjects projects : centerdataTKeyProjects){
             if (StringUtils.isEmpty(projects.getProjectId())||StringUtils.isEmpty(projects.getProjectName())||StringUtils.isEmpty(projects.getLongitude())||
-                    StringUtils.isEmpty(projects.getLatitude())||StringUtils.isEmpty(projects.getTerritoriality())||StringUtils.isEmpty(projects.getPrincipal())||
-                    StringUtils.isEmpty(projects.getPhone())||StringUtils.isEmpty(projects.getConstructionSite())||StringUtils.isEmpty(projects.getNature())||
-            StringUtils.isEmpty(projects.getIntroduction())){
+                    StringUtils.isEmpty(projects.getLatitude())|| StringUtils.isEmpty(projects.getNature())){
                 return AjaxResult.error(5002, "缺少必要参数");
             }
             if (projects.getEndTime()!=null&&projects.getStartTime()!=null){

+ 5 - 5
src/main/java/com/sooka/sponest/data/generalbusiness/domain/CenterdataTKeyProjects.java

@@ -34,7 +34,7 @@ public class CenterdataTKeyProjects extends BaseBusinessEntity {
      */
     @ApiModelProperty(value = "属地辖区", required = false)
     @Excel(name = "属地辖区")
-    @NotBlank(message = "属地辖区不能为空")
+//    @NotBlank(message = "属地辖区不能为空")
     private String territoriality;
 
     /**
@@ -120,7 +120,7 @@ public class CenterdataTKeyProjects extends BaseBusinessEntity {
      */
     @ApiModelProperty(value = "负责人", required = false)
     @Excel(name = "负责人")
-    @NotBlank(message = "负责人不能为空")
+//    @NotBlank(message = "负责人不能为空")
     private String principal;
 
     /**
@@ -128,7 +128,7 @@ public class CenterdataTKeyProjects extends BaseBusinessEntity {
      */
     @ApiModelProperty(value = "联系电话", required = false)
     @Excel(name = "联系电话")
-    @NotBlank(message = "联系电话不能为空")
+//    @NotBlank(message = "联系电话不能为空")
     private String phone;
 
     /**
@@ -152,7 +152,7 @@ public class CenterdataTKeyProjects extends BaseBusinessEntity {
      */
     @ApiModelProperty(value = "建设地点", required = false)
     @Excel(name = "建设地点")
-    @NotBlank(message = "建设地点不能为空")
+//    @NotBlank(message = "建设地点不能为空")
     private String constructionSite;
 
     /**
@@ -246,7 +246,7 @@ public class CenterdataTKeyProjects extends BaseBusinessEntity {
      */
     @ApiModelProperty(value = "建设内容", required = false)
     @Excel(name = "建设内容")
-    @NotBlank(message = "建设内容不能为空")
+//    @NotBlank(message = "建设内容不能为空")
     private String introduction;
 
     public Long getDeptId() {

+ 16 - 0
src/main/java/com/sooka/sponest/data/generalbusiness/mapper/CenterdataTKeyProjectsMapper.java

@@ -59,4 +59,20 @@ public interface CenterdataTKeyProjectsMapper {
     * @date 2024/1/18 15:23
     */
     String getSelectScheduleById(String id);
+
+    /*
+    * 查询项目id集合
+    *
+    * @author 韩福成
+    * @date 2024/4/2 9:56
+    */
+    List<String> getProjectId();
+
+    /*
+    * 按项目id修改重点工程
+    *
+    * @author 韩福成
+    * @date 2024/4/2 10:06
+    */
+    int updateByProjectId(CenterdataTKeyProjects centerdataTKeyProjects);
 }

+ 11 - 7
src/main/java/com/sooka/sponest/data/generalbusiness/service/impl/CenterdataTKeyProjectsServiceImpl.java

@@ -138,13 +138,22 @@ public class CenterdataTKeyProjectsServiceImpl extends BaseServiceImpl implement
     */@Override
     public int receivedMessage(List<CenterdataTKeyProjects> centerdataTKeyProjects) {
         logger.info("token=========================="+ SecurityUtils.getToken());
+        List<String> project = centerdataTKeyProjectsMapper.getProjectId();
         int i = 0;
 //        LoginUser user = tokenService.getLoginUser(SecurityUtils.getToken());
         logger.info("user=========================="+ SecurityUtils.getLoginUser());
         for (CenterdataTKeyProjects projects : centerdataTKeyProjects){
-            CenterdataTKeyProjects project = centerdataTKeyProjectsMapper.selectCenterdataTKeyProjectsById(projects.getId());
             projects.setMessage(JSON.toJSONString(projects));
-            if (project==null){
+            if (project.contains(projects.getProjectId())){
+                boolean matches = projects.getConstructionSite().matches(".*\\s{2,}.*");
+                if (matches){
+                    projects.setConstructionSite(null);
+                }
+                projects.setUpdateBy(SecurityUtils.getUserId());
+                projects.setUpdateTime(DateUtils.getNowDate());
+                projects.setUpdateName( SecurityUtils.getLoginUser().getSysUser().getNickName());
+                i = centerdataTKeyProjectsMapper.updateByProjectId(projects);
+            }else {
                 projects.setId(IdUtils.fastUUID());
                 projects.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId());
                 projects.setDeptName(SecurityUtils.getLoginUser().getSysUser().getDeptNames());
@@ -152,11 +161,6 @@ public class CenterdataTKeyProjectsServiceImpl extends BaseServiceImpl implement
                 projects.setCreateName( SecurityUtils.getLoginUser().getSysUser().getNickName());
                 projects.setCreateTime(DateUtils.getNowDate());
                 i = centerdataTKeyProjectsMapper.insertCenterdataTKeyProjects(projects);
-            }else {
-                projects.setUpdateBy(SecurityUtils.getUserId());
-                projects.setUpdateTime(DateUtils.getNowDate());
-                projects.setUpdateName( SecurityUtils.getLoginUser().getSysUser().getNickName());
-                i = centerdataTKeyProjectsMapper.updateCenterdataTKeyProjects(projects);
             }
         }
         return i;

+ 51 - 1
src/main/resources/mapper/generalbusiness/CenterdataTKeyProjectsMapper.xml

@@ -258,4 +258,54 @@
             a.schedule_time DESC
             LIMIT 1
     </select>
-</mapper>
+
+    <select id="getProjectId" parameterType="String" resultType="java.lang.String">
+        SELECT project_id projectId from centerdata_t_key_projects
+    </select>
+
+    <update id="updateByProjectId" parameterType="CenterdataTKeyProjects">
+        update centerdata_t_key_projects
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="projectName != null">project_name = #{projectName},</if>
+            <if test="projectTarget != null">project_target = #{projectTarget},</if>
+            <if test="projectType != null">project_type = #{projectType},</if>
+            <if test="projectLevel != null">project_level = #{projectLevel},</if>
+            <if test="constructionUnit != null">construction_unit = #{constructionUnit},</if>
+            <if test="principal != null">principal = #{principal},</if>
+            <if test="phone != null">phone = #{phone},</if>
+            <if test="constructionSite != null">construction_site = #{constructionSite},</if>
+            <if test="constructionArea != null">construction_area = #{constructionArea},</if>
+            <if test="longitude != null">longitude = #{longitude},</if>
+            <if test="latitude != null">latitude = #{latitude},</if>
+            <if test="cameraSystem != null">camera_system = #{cameraSystem},</if>
+            <if test="deptId != null and deptId != ''">dept_id = #{deptId},</if>
+            <if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
+            <if test="photoId != null">photo_id = #{photoId},</if>
+            <if test="orderNum != null">order_num = #{orderNum},</if>
+            <if test="introduction != null">introduction = #{introduction},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createName != null">create_name = #{createName},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateName != null">update_name = #{updateName},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="territoriality != null">territoriality = #{territoriality},</if>
+            <if test="park != null">park = #{park},</if>
+            <if test="parkLongitude != null">park_longitude = #{parkLongitude},</if>
+            <if test="parkLatitude != null">park_latitude = #{parkLatitude},</if>
+            <if test="environment != null">environment = #{environment},</if>
+            <if test="legalUnit != null">legal_unit = #{legalUnit},</if>
+            <if test="startTime != null">start_time = #{startTime},</if>
+            <if test="endTime != null">end_time = #{endTime},</if>
+            <if test="nature != null">nature = #{nature},</if>
+            <if test="totalInvest != null">total_invest = #{totalInvest},</if>
+            <if test="yearInvest != null">year_invest = #{yearInvest},</if>
+            <if test="industryType != null">industry_type = #{industryType},</if>
+            <if test="secretary != null">secretary = #{secretary},</if>
+            <if test="secretaryDuties != null">secretary_duties = #{secretaryDuties},</if>
+            <if test="secretaryPhone != null">secretary_phone = #{secretaryPhone},</if>
+            <if test="message != null">message = #{message},</if>
+        </trim>
+        where project_id = #{projectId}
+    </update>
+</mapper>