Browse Source

修改单提交后同步内部损失

DLC 1 month ago
parent
commit
b5c634572a

+ 14 - 0
qcs-common/src/main/java/com/rongwei/bscommon/sys/dao/QcsMdfFormDao.java

@@ -3,6 +3,7 @@ package com.rongwei.bscommon.sys.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.rongwei.bsentity.domain.QcsLossDetailDo;
 import com.rongwei.bsentity.domain.QcsMdfFormDo;
 import org.apache.ibatis.annotations.Delete;
 import org.apache.ibatis.annotations.Param;
@@ -27,4 +28,17 @@ public interface QcsMdfFormDao extends BaseMapper<QcsMdfFormDo> {
 
     @Update("update qcs_mdf_detail set STATUS='已提交',MODIFYDATE=NOW(),SUBMITDATE=NOW() where FORMID=#{formId} and DEPTID=#{deptId}")
     void upStatus(@Param("formId") String formId, @Param("deptId") String deptId);
+
+    @Select("select d.ID,d.PROID,d.LOSSNO,d.MAINID,cc.SUBJECTNO as MODIFYREASON from qcs_loss_detail d left join qcs_main_cost c on d.MAINID=c.ID left join qcs_column_config cc on c.ID=cc.LOSSID\n" +
+            "where d.DELETED='0' and c.DELETED='0' and cc.DELETED='0' and c.BASEID=#{baseId} and DATE_FORMAT(c.YEARMONTH,'%Y-%m')=#{yearMonth} and cc.THRSUBJECT='设计变更损失'")
+    List<QcsLossDetailDo> getLossDetails(@Param("baseId") String baseId, @Param("yearMonth") String yearMonth);
+
+    @Select("select SUM(ACTAMOUNT) as ACTAMOUNTSUM from qcs_mdf_detail where DELETED='0' and FORMID=#{formId} and DEPTID=#{deptId}")
+    Map<String, Object> getDeptAmountSum(@Param("formId") String formId, @Param("deptId") String deptId);
+
+    @Update("update qcs_loss_detail set ${subjectNo}=${subjectval},MODIFYDATE=NOW() where ID=#{lossId}")
+    void upAmount(@Param("lossId") String lossId, @Param("subjectNo") String subjectNo, @Param("subjectval") String subjectval);
+
+    @Update("${inSql}")
+    void insertLossDetail(@Param(value = "inSql") String inSql);
 }

File diff suppressed because it is too large
+ 45 - 0
qcs-common/src/main/java/com/rongwei/bscommon/sys/service/impl/QcsMdfFormServiceImpl.java