Commit c14eb3cc by Suvalue

预算页保存时只删除需要保存的老数据

parent 67a13aaf
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>123</title>
</head>
<body>
123
</body>
</html>
\ No newline at end of file
...@@ -27,5 +27,7 @@ public interface SerProjValueMapper { ...@@ -27,5 +27,7 @@ public interface SerProjValueMapper {
int deleteByDeptWithDate(@Param("dept") String dept,@Param("date") BigDecimal date, int deleteByDeptWithDate(@Param("dept") String dept,@Param("date") BigDecimal date,
@Param("projType") Integer projType); @Param("projType") Integer projType);
int deleteByProj(@Param("dept") String dept,@Param("date") BigDecimal date,@Param("projId") BigDecimal projId);
void updateValue(@Param("date") BigDecimal date,@Param("hosCode") String hosCode); void updateValue(@Param("date") BigDecimal date,@Param("hosCode") String hosCode);
} }
\ No newline at end of file
...@@ -87,10 +87,12 @@ public class SerProjValueServiceImpl implements SerProjValueService { ...@@ -87,10 +87,12 @@ public class SerProjValueServiceImpl implements SerProjValueService {
String orgCode = orgList.get(0).getOrgCode(); String orgCode = orgList.get(0).getOrgCode();
if(request != null && request.getBudgetValues() != null && request.getBudgetValues().size() > 0){ if(request != null && request.getBudgetValues() != null && request.getBudgetValues().size() > 0){
//先进行删除操作 //先进行删除操作
result = serProjValueMapper.deleteByDeptWithDate(request.getDeptCode(),request.getDate(),request.getProjType()); // result = serProjValueMapper.deleteByDeptWithDate(request.getDeptCode(),request.getDate(),request.getProjType());
SerProjValue info = null; SerProjValue info = null;
long version = System.currentTimeMillis(); long version = System.currentTimeMillis();
for(BudgetValue budgetValue : request.getBudgetValues()){ for(BudgetValue budgetValue : request.getBudgetValues()){
//先进行删除操作
serProjValueMapper.deleteByProj(request.getDeptCode(),request.getDate(),budgetValue.getProjId());
info = new SerProjValue(budgetValue); info = new SerProjValue(budgetValue);
info.setDate(request.getDate()); info.setDate(request.getDate());
info.setDeptCode(request.getDeptCode()); info.setDeptCode(request.getDeptCode());
......
...@@ -148,6 +148,12 @@ ...@@ -148,6 +148,12 @@
and v.DEPT_CODE = #{dept,jdbcType=VARCHAR} and v.DEPT_CODE = #{dept,jdbcType=VARCHAR}
and v1.ID = v.ID) and v1.ID = v.ID)
</update> </update>
<update id="deleteByProj">
update SER_PROJ_VALUE set STATE = 0
where "DATE" = #{date,jdbcType=DECIMAL}
and DEPT_CODE = #{dept,jdbcType=VARCHAR}
and projId = #{projId,jdbcType=DECIMAL}
</update>
<update id="updateValue" statementType="CALLABLE"> <update id="updateValue" statementType="CALLABLE">
{call ESTIMATE_UPDATE_GZD_BL( {call ESTIMATE_UPDATE_GZD_BL(
#{date,jdbcType=DECIMAL}, #{date,jdbcType=DECIMAL},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment