lem vor 3 Jahren
Ursprung
Commit
de6c10c8f7

+ 7 - 7
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/modules/deductiondetails/mapper/xml/DeductionDetailsMapper.xml

@@ -174,17 +174,17 @@
 		a.id AS "id",
 		a.yearofevaluation as "yearOfEvaluation",
 		a.unitname as "evaName",
-		(case when ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = '8c9fe0f62745471e8c341e0e7327aa9b' GROUP BY unitid ) is not null then ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = '8c9fe0f62745471e8c341e0e7327aa9b' GROUP BY unitid ) else 0 end ) AS safetyEva,
-		(case when ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = '7a77a8251b124e858a1bef1bb353372b' GROUP BY unitid ) is not null then ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = '7a77a8251b124e858a1bef1bb353372b' GROUP BY unitid ) else 0 end ) AS progressEva,
-		(case when ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = '783ba447e0774b139fa1dc6ad4eeb4f3' GROUP BY unitid ) is not null then ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = '783ba447e0774b139fa1dc6ad4eeb4f3' GROUP BY unitid ) else 0 end ) AS costEva,
-		(case when ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = 'bc91443b714c4993a3b136e000eb8bc2' GROUP BY unitid ) is not null then ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = 'bc91443b714c4993a3b136e000eb8bc2' GROUP BY unitid ) else 0 end ) AS qualityEva,
-		(case when ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = '2f0e74b9e50b4bbb8d6322feac578076' GROUP BY unitid ) is not null then ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = '2f0e74b9e50b4bbb8d6322feac578076' GROUP BY unitid ) else 0 end ) AS pointsEva,
+		(25-(case when ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = '8c9fe0f62745471e8c341e0e7327aa9b' GROUP BY unitid ) is not null then ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = '8c9fe0f62745471e8c341e0e7327aa9b' GROUP BY unitid ) else 0 end )) AS safetyEva,
+		(25-(case when ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = '7a77a8251b124e858a1bef1bb353372b' GROUP BY unitid ) is not null then ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = '7a77a8251b124e858a1bef1bb353372b' GROUP BY unitid ) else 0 end )) AS progressEva,
+		(25-(case when ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = '783ba447e0774b139fa1dc6ad4eeb4f3' GROUP BY unitid ) is not null then ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = '783ba447e0774b139fa1dc6ad4eeb4f3' GROUP BY unitid ) else 0 end )) AS costEva,
+		(25-(case when ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = 'bc91443b714c4993a3b136e000eb8bc2' GROUP BY unitid ) is not null then ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = 'bc91443b714c4993a3b136e000eb8bc2' GROUP BY unitid ) else 0 end )) AS qualityEva,
+		(25-(case when ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = '2f0e74b9e50b4bbb8d6322feac578076' GROUP BY unitid ) is not null then ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = '2f0e74b9e50b4bbb8d6322feac578076' GROUP BY unitid ) else 0 end )) AS pointsEva,
 		(
-		CASE WHEN ( SELECT sum( veto ) FROM deduction_details WHERE unitid = @id AND classid = '2f0e74b9e50b4bbb8d6322feac578076' GROUP BY unitid ) > 0 THEN '是' ELSE '否'
+		CASE WHEN ( SELECT sum( veto ) FROM deduction_details WHERE unitid = @id  GROUP BY unitid ) > 0 THEN '是' ELSE '否'
 		END
 		) AS veto,
 		(case when (
-		CASE WHEN ( SELECT sum( veto ) FROM deduction_details WHERE unitid = @id AND classid = '2f0e74b9e50b4bbb8d6322feac578076' GROUP BY unitid ) > 0 THEN '是' ELSE '否'
+		CASE WHEN ( SELECT sum( veto ) FROM deduction_details WHERE unitid = @id  GROUP BY unitid ) > 0 THEN '是' ELSE '否'
 		END
 		) = '否' then ((case when ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = '8c9fe0f62745471e8c341e0e7327aa9b' GROUP BY unitid ) is not null then ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = '8c9fe0f62745471e8c341e0e7327aa9b' GROUP BY unitid ) else 0 end )+
 		(case when ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = '7a77a8251b124e858a1bef1bb353372b' GROUP BY unitid ) is not null then ( SELECT sum( deductpoints ) FROM deduction_details WHERE unitid = @id AND classid = '7a77a8251b124e858a1bef1bb353372b' GROUP BY unitid ) else 0 end )+

+ 2 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/modules/deductionshowdetails/mapper/DeductionShowDetailsMapper.java

@@ -29,4 +29,6 @@ public interface DeductionShowDetailsMapper extends BaseMapper<DeductionShowDeta
     List<OtherPoints> findOtherPointsList(OtherPoints otherPoints);
 
     void deleteDetails(String id);
+
+    String getName(String id);
 }

+ 12 - 12
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/modules/deductionshowdetails/mapper/xml/DeductionShowDetailsMapper.xml

@@ -49,7 +49,7 @@
 			a.deductpoints as "deductPoints",
 			a.deductiondetails as "deductionDetails",
 			a.deductiondate as "deductionDate",
-			case when a.veto = 0 then '否' else '是' end as "veto"
+			a.veto as "veto"
 		FROM
 			deduction_details a
 				LEFT JOIN lishu_construction_unit b ON a.unitId = b.id
@@ -196,17 +196,12 @@
 
 	<update id="update">
 		UPDATE DeductionShowDetails SET
-			unitid = #{unitId},
-			classid = #{classId},
-			subclassid = #{subClassId},
-			yearofevaluation = #{yearOfEvaluation},
-			unitname = #{unitName},
-			bigname = #{bigName},
-			serialnumber = #{serialNumber},
-			smallname = #{smallName},
-			deductpoints = #{deductPoints},
-			deductiondetails = #{deductionDetails},
-			deductiondate = #{deductionDate},
+			unitid = #{unitid},
+			classid = #{classid},
+			subclassid = #{subclassid},
+			deductpoints = #{deductpoints},
+			deductiondetails = #{deductiondetails},
+			deductiondate = #{deductiondate},
 			veto = #{veto},
 			update_by = #{updateBy.id},
 			update_date = #{updateDate},
@@ -490,5 +485,10 @@
 			</otherwise>
 		</choose>
 	</select>
+	<select id="getName" resultType="java.lang.String">
+		select unitname
+		from lishu_construction_unit
+		where id = #{id}
+	</select>
 
 </mapper>

+ 10 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/modules/deductionshowdetails/service/DeductionShowDetailsService.java

@@ -41,6 +41,12 @@ public class DeductionShowDetailsService extends CrudService<DeductionShowDetail
 	}
 
 	@Transactional(readOnly = false)
+	public void update(DeductionShowDetails deductionShowDetails) {
+		deductionShowDetails.preUpdate();
+		mapper.update(deductionShowDetails);
+	}
+
+	@Transactional(readOnly = false)
 	public void delete(DeductionShowDetails deductionShowDetails) {
 		super.delete(deductionShowDetails);
 	}
@@ -74,6 +80,10 @@ public class DeductionShowDetailsService extends CrudService<DeductionShowDetail
 		return page;
 	}
 
+	public String  getName(String id) {
+		return mapper.getName(id);
+	}
+
 	public Page<OtherPoints> findOtherPointsList(Page<OtherPoints> page, OtherPoints otherPoints) {
 		dataRuleFilter(otherPoints);
 		otherPoints.setPage(page);

+ 20 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/modules/deductionshowdetails/web/DeductionShowDetailsController.java

@@ -68,6 +68,16 @@ public class DeductionShowDetailsController extends BaseController {
 	}
 
 	/**
+	 * 扣分详细列表数据
+	 */
+	@RequiresPermissions("deductionShowDetails:deductionShowDetails:list")
+	@GetMapping("getName")
+	public AjaxJson getName(String  id, HttpServletRequest request, HttpServletResponse response) {
+		String name = deductionShowDetailsService.getName(id);
+		return AjaxJson.success().put("unitName", name);
+	}
+
+	/**
 	 * 根据Id获取扣分详细数据
 	 */
 	@RequiresPermissions(value={"deductionShowDetails:deductionShowDetails:view","deductionShowDetails:deductionShowDetails:add","deductionShowDetails:deductionShowDetails:edit"},logical=Logical.OR)
@@ -94,6 +104,16 @@ public class DeductionShowDetailsController extends BaseController {
 		return AjaxJson.success("保存扣分详细成功");
 	}
 
+	/**
+	 * 保存扣分详细
+	 */
+	@RequiresPermissions(value={"deductionShowDetails:deductionShowDetails:add","deductionShowDetails:deductionShowDetails:edit"},logical=Logical.OR)
+	@PostMapping("update")
+	public AjaxJson update(DeductionShowDetails deductionShowDetails, Model model) throws Exception{
+		//新增或编辑表单保存
+		deductionShowDetailsService.update(deductionShowDetails);//保存
+		return AjaxJson.success("保存扣分详细成功");
+	}
 
 	/**
 	 * 批量删除扣分详细