Ver Fonte

Merge branch 'feature-bieao' of lift-manager/lift-server into develop

bieao há 5 anos atrás
pai
commit
ee41c6e589

+ 3 - 3
lift-business-service/src/main/java/cn/com/ty/lift/business/capital/service/SignInService.java

@@ -65,9 +65,9 @@ public class SignInService extends ServiceImpl<SignInMapper, SignIn> {
      * @date 2020/4/20 9:29 下午
      */
     public RestResponse signIn(CapitalRepairRequest request) {
-        boolean ret = VerifyUtils.preJudgment(request.getCoordinate());
-        if (!ret)
-            return RestResponse.fail(MessageUtils.get("msg.longitude.error"));
+//        boolean ret = VerifyUtils.preJudgment(request.getCoordinate());
+//        if (!ret)
+//            return RestResponse.fail(MessageUtils.get("msg.longitude.error"));
         SignIn oldSignIn = getOne(request.getMtCompanyId(), request.getProjectId(), request.getUserId());
         if (ObjectUtil.isNotEmpty(oldSignIn)) {
             String approachTime = oldSignIn.getApproachTime();

+ 13 - 13
lift-business-service/src/main/java/cn/com/ty/lift/business/common/CommonController.java

@@ -98,13 +98,13 @@ public class CommonController {
         for (MultipartFile file : files) {
             String currentTime = DateUtil.formatDateTime(new Date());
             //上传图片加图片水印
-            ImageUtil.pressImage(null, file, "/home/ying/server/lift-business/tmp/watermark.png", "/home/ying/server/lift-business/tmp/imgBack.png", "right-bottom", null);
+            //ImageUtil.pressImage(null, file, "/home/ying/server/lift-business/tmp/watermark.png", "/home/ying/server/lift-business/tmp/imgBack.png", "right-bottom", null);
             //上传图片加文字水印
-            ImageUtil.pressText("/home/ying/server/lift-business/tmp/imgBack.png", currentTime, "/home/ying/server/lift-business/tmp/imgBack.png", "黑体", Font.BOLD + Font.ITALIC, 30, "left-bottom", Color.GRAY);
-            File downloadFile = new File("/home/ying/server/lift-business/tmp/imgBack.png");
-            FileItem fileItem = ImageUtil.createFileItem(downloadFile, downloadFile.getName());
-            MultipartFile mfile = new CommonsMultipartFile(fileItem);
-            String fileName = handleFile(mfile);
+            //ImageUtil.pressText("/home/ying/server/lift-business/tmp/imgBack.png", currentTime, "/home/ying/server/lift-business/tmp/imgBack.png", "黑体", Font.BOLD + Font.ITALIC, 30, "left-bottom", Color.GRAY);
+            //File downloadFile = new File("/home/ying/server/lift-business/tmp/imgBack.png");
+            //FileItem fileItem = ImageUtil.createFileItem(downloadFile, downloadFile.getName());
+            //MultipartFile mfile = new CommonsMultipartFile(fileItem);
+            String fileName = handleFile(file);
             fileMap.put(fileName, file);
         }
         //2 批量上传
@@ -132,15 +132,15 @@ public class CommonController {
     @PostMapping("upload")
     public RestResponse upload(@RequestParam("file") MultipartFile file) {
         Validate.notTrue(Objects.isNull(file) || file.isEmpty(), ValuePool.UPLOAD_DATA_MISSING);
-        String currentTime = DateUtil.formatDateTime(new Date());
+        //String currentTime = DateUtil.formatDateTime(new Date());
         //上传图片加图片水印
-        ImageUtil.pressImage(null, file, "/home/ying/server/lift-business/tmp/watermark.png", "/home/ying/server/lift-business/tmp/imgBack.png", "right-bottom", null);
+        //ImageUtil.pressImage(null, file, "/home/ying/server/lift-business/tmp/watermark.png", "/home/ying/server/lift-business/tmp/imgBack.png", "right-bottom", null);
         //上传图片加文字水印
-        ImageUtil.pressText("/home/ying/server/lift-business/tmp/imgBack.png", currentTime, "/home/ying/server/lift-business/tmp/imgBack.png", "黑体", Font.BOLD + Font.ITALIC, 30, "left-bottom", Color.GRAY);
-        File downloadFile = new File("/home/ying/server/lift-business/tmp/imgBack.png");
-        FileItem fileItem = ImageUtil.createFileItem(downloadFile, downloadFile.getName());
-        MultipartFile mfile = new CommonsMultipartFile(fileItem);
-        String fileName = handleFile(mfile);
+        //ImageUtil.pressText("/home/ying/server/lift-business/tmp/imgBack.png", currentTime, "/home/ying/server/lift-business/tmp/imgBack.png", "黑体", Font.BOLD + Font.ITALIC, 30, "left-bottom", Color.GRAY);
+        //File downloadFile = new File("/home/ying/server/lift-business/tmp/imgBack.png");
+        //FileItem fileItem = ImageUtil.createFileItem(downloadFile, downloadFile.getName());
+        //MultipartFile mfile = new CommonsMultipartFile(fileItem);
+        String fileName = handleFile(file);
         try {
             String url = systemConfiguration.build().putObject(fileName, file.getBytes());
             log.info("upload file complete, file URL: {}", url);

+ 6 - 6
lift-business-service/src/main/java/cn/com/ty/lift/business/library/service/LiftService.java

@@ -407,12 +407,12 @@ public class LiftService extends ServiceImpl<LiftMapper, Lift> {
         Optional<Lift> oldLift = getOne(null, lift.getId());
         if (!oldLift.isPresent())
             return RestResponse.fail(MessageUtils.get("msg.lift.not.exist"));
-        String coordinate = lift.getCoordinate();
-        if (Objects.nonNull(coordinate)) {
-            boolean ret = VerifyUtils.preJudgment(coordinate);
-            if (!ret)
-                return RestResponse.fail(MessageUtils.get("msg.longitude.error"));
-        }
+//        String coordinate = lift.getCoordinate();
+//        if (Objects.nonNull(coordinate)) {
+//            boolean ret = VerifyUtils.preJudgment(coordinate);
+//            if (!ret)
+//                return RestResponse.fail(MessageUtils.get("msg.longitude.error"));
+//        }
         LocalDate lastDay = lift.getAnnualInspectionDate().with(TemporalAdjusters.lastDayOfMonth());
         lift.setAnnualInspectionDate(lastDay);
         boolean result = updateById(lift);

+ 3 - 3
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/service/MaintenanceRecordService.java

@@ -194,9 +194,9 @@ public class MaintenanceRecordService extends ServiceImpl<MaintenanceRecordMappe
             return RestResponse.fail(MessageUtils.get("msg.exist.record"));
         String coordinate = request.getCoordinate();
         //校验是否为经纬度
-        boolean verifyResult = VerifyUtils.preJudgment(coordinate);
-        if (!verifyResult)
-            return RestResponse.fail(MessageUtils.get("msg.longitude.error"));
+//        boolean verifyResult = VerifyUtils.preJudgment(coordinate);
+//        if (!verifyResult)
+//            return RestResponse.fail(MessageUtils.get("msg.longitude.error"));
         //维保工是否在电梯附近
         boolean result = calc(liftCoordinate, coordinate);
         if (result)

+ 1 - 1
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/service/MaintenanceService.java

@@ -33,6 +33,6 @@ public class MaintenanceService {
         int limitedNum = company.getLimitedNum();
         //获取该公司企业电梯关联表的实际电梯台量
         int currentNum = platformService.countLiftNum(mtCompanyId);
-        return currentNum >= limitedNum;
+        return limitedNum >= currentNum;
     }
 }

+ 4 - 6
lift-business-service/src/main/resources/mapper/maintenance/MaintenanceRecordMapper.xml

@@ -100,7 +100,7 @@
 	<!--app端 保养任务列表 (1:保养中、2:已完成) -->
 	<select id="findRecordByWorkerId" resultType="cn.com.ty.lift.business.maintenance.dao.entity.model.response.MaintenanceAppResponse"
 			parameterType="cn.com.ty.lift.business.maintenance.dao.entity.model.request.MaintenanceRecordRequest">
-		SELECT p.project_name AS projectName,
+		SELECT DISTINCT p.project_name AS projectName,
 			p.id                AS projectId,
 			mr.id               AS mtPlanId,
 			mr.id               AS recordId,
@@ -224,7 +224,7 @@
         LEFT JOIN user_info ui ON mr.worker_id1 = ui.user_id
         LEFT JOIN project pr ON mr.project_id = pr.id AND pr.mt_company_id = mr.mt_company_id
         LEFT JOIN evaluation ev ON mr.id = ev.record_id
-        <where>
+        WHERE ((status = '2' AND has_evaluate = '0') or (status = '2' AND has_evaluate = '1'))
             <if test="cond.mtCompanyId != null and cond.mtCompanyId > 0">
                 AND mr.mt_company_id = #{cond.mtCompanyId}
             </if>
@@ -246,21 +246,19 @@
             <if test="cond.workDate != null">
                 AND mr.work_date = #{cond.workDate}
             </if>
-        </where>
     </select>
 
     <!--日常保养-保养单:根据条件汇总条数-->
     <select id="countRecordByCondition" resultType="java.lang.Long"
             parameterType="cn.com.ty.lift.business.maintenance.dao.entity.model.request.MtRecordRequest">
         SELECT
-        count(*)
+        count(1)
         FROM
         maintenance_record mr
-        <where>
+        WHERE  ((status = '2' AND has_evaluate = '0') or (status = '2' AND has_evaluate = '1'))
             <if test="cond.mtCompanyId != null and cond.mtCompanyId > 0">
                 AND mr.mt_company_id = #{cond.mtCompanyId}
             </if>
-        </where>
     </select>
 
     <!--日常保养-保养单:根据id查询,带关联信息-->

+ 1 - 1
lift-business-service/src/main/resources/mapper/project/ProjectMapper.xml

@@ -166,7 +166,7 @@
 		p.actual_num    AS actualNum,
 		p.project_status AS projectStatus
 		FROM project p
-		WHERE 1=1
+		WHERE project_status != '3'
 		<if test="request.mtCompanyId!=null and request.mtCompanyId!=''">
 			AND p.mt_company_id = #{request.mtCompanyId,jdbcType=BIGINT}
 		</if>

+ 0 - 2
lift-common/src/main/java/cn.com.ty.lift.common/constants/CommonEnum.java

@@ -148,8 +148,6 @@ public class CommonEnum {
      * 项目状态
      */
     public enum ProjectStatus implements IEnum {
-
-        DELETE("删除", "0"),
         NOT_START("尚未开始", "1"),
         IN_SERVICE("服务中", "2"),
         STOP_SERVICE("停止服务", "3"),

+ 4 - 4
lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/oa/controller/AttendanceController.java

@@ -185,10 +185,10 @@ public class AttendanceController {
      */
     @PostMapping("clock")
     public RestResponse clock(@Valid @RequestBody Attendance entity) {
-        String coordinate = entity.getCoordinate();
-        boolean ret = VerifyUtils.preJudgment(coordinate);
-        if (!ret)
-            return RestResponse.fail("请输入正确的经纬度");
+//        String coordinate = entity.getCoordinate();
+//        boolean ret = VerifyUtils.preJudgment(coordinate);
+//        if (!ret)
+//            return RestResponse.fail("请输入正确的经纬度");
         Long mtCompanyId = entity.getMtCompanyId();
         Long userId = entity.getUserId();
         Integer type = entity.getType();