Commit 67a13aaf by Suvalue

预算页实值调整

parent 0073b8a0
...@@ -17,6 +17,6 @@ public interface SerProjValueSzMapper { ...@@ -17,6 +17,6 @@ public interface SerProjValueSzMapper {
int updateByPrimaryKey(SerProjValueSz record); int updateByPrimaryKey(SerProjValueSz record);
List<SerProjValueSz> selectByProj(@Param("projId") BigDecimal projId,@Param("date") Integer date, SerProjValueSz selectByProj(@Param("projId") BigDecimal projId,@Param("date") Integer date,
@Param("deptCode") String deptCode,@Param("hosCode") String hosCode); @Param("deptCode") String deptCode,@Param("hosCode") String hosCode);
} }
\ No newline at end of file
...@@ -12,6 +12,5 @@ public class SerProjValueResp extends SerProjValue { ...@@ -12,6 +12,5 @@ public class SerProjValueResp extends SerProjValue {
private String projName; private String projName;
private BigDecimal isBudget; private BigDecimal isBudget;
private BigDecimal parent; private BigDecimal parent;
private List<SerProjValueSz> valueSz;
private List<SerProjValueResp> childs; private List<SerProjValueResp> childs;
} }
...@@ -13,7 +13,6 @@ import com.bsoft.api.model.reqmodel.AddBudgetValue; ...@@ -13,7 +13,6 @@ import com.bsoft.api.model.reqmodel.AddBudgetValue;
import com.bsoft.api.model.reqmodel.BudgetValue; import com.bsoft.api.model.reqmodel.BudgetValue;
import com.bsoft.api.model.respmodel.*; import com.bsoft.api.model.respmodel.*;
import com.bsoft.api.service.SerProjValueService; import com.bsoft.api.service.SerProjValueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -50,7 +49,7 @@ public class SerProjValueServiceImpl implements SerProjValueService { ...@@ -50,7 +49,7 @@ public class SerProjValueServiceImpl implements SerProjValueService {
List<ProjectInfo> projectInfo = null; List<ProjectInfo> projectInfo = null;
List<SerProjValueResp> values = null; List<SerProjValueResp> values = null;
List<SerProjValueResp> resultValues = null; List<SerProjValueResp> resultValues = null;
List<SerProjValueSz> valueSzs = null; SerProjValueSz valueSz = null;
for(Map<String,Object> enumInfo : enumList){ for(Map<String,Object> enumInfo : enumList){
projectValue = new ProjectValue(); projectValue = new ProjectValue();
projectValue.setTypeId((Integer)enumInfo.get("value")); projectValue.setTypeId((Integer)enumInfo.get("value"));
...@@ -61,8 +60,12 @@ public class SerProjValueServiceImpl implements SerProjValueService { ...@@ -61,8 +60,12 @@ public class SerProjValueServiceImpl implements SerProjValueService {
values = serProjValueMapper.selectValue(projectType,(Integer)enumInfo.get("value"), values = serProjValueMapper.selectValue(projectType,(Integer)enumInfo.get("value"),
projInfo.getExponentId(),deptCode,date,BudgetType.NOT.getValue(),orgCode); projInfo.getExponentId(),deptCode,date,BudgetType.NOT.getValue(),orgCode);
for(SerProjValueResp value : values){ for(SerProjValueResp value : values){
valueSzs = projValueSzMapper.selectByProj(value.getProjId(),date,deptCode,orgCode); valueSz = projValueSzMapper.selectByProj(value.getProjId(),date,deptCode,orgCode);
value.setValueSz(valueSzs); if(valueSz != null){
value.setSz(valueSz.getSz());
value.setZxpl(valueSz.getZxpl());
valueSz = null;
}
} }
resultValues = getLevelData(values,BigDecimal.valueOf(PROJ_TOP_PARENT_ID)); resultValues = getLevelData(values,BigDecimal.valueOf(PROJ_TOP_PARENT_ID));
if(resultValues != null && resultValues.size() > 0) if(resultValues != null && resultValues.size() > 0)
...@@ -115,6 +118,7 @@ public class SerProjValueServiceImpl implements SerProjValueService { ...@@ -115,6 +118,7 @@ public class SerProjValueServiceImpl implements SerProjValueService {
List<Map<String,Object>> enumList = ProjectType.all(); List<Map<String,Object>> enumList = ProjectType.all();
SummaryProjType projType = null; SummaryProjType projType = null;
List<ProjectInfo> projectInfo = null; List<ProjectInfo> projectInfo = null;
SerProjValueSz valueSz = null;
if(enumList != null && enumList.size() > 0){ if(enumList != null && enumList.size() > 0){
for(Map<String,Object> enumInfo : enumList){ for(Map<String,Object> enumInfo : enumList){
projType = new SummaryProjType(); projType = new SummaryProjType();
...@@ -123,7 +127,12 @@ public class SerProjValueServiceImpl implements SerProjValueService { ...@@ -123,7 +127,12 @@ public class SerProjValueServiceImpl implements SerProjValueService {
null,summary.getDeptCode(),date,budgetType,orgCode); null,summary.getDeptCode(),date,budgetType,orgCode);
if(values != null){ if(values != null){
for(SerProjValueResp value : values){ for(SerProjValueResp value : values){
value.setValueSz(projValueSzMapper.selectByProj(value.getProjId(),date,summary.getDeptCode(),orgCode)); valueSz = projValueSzMapper.selectByProj(value.getProjId(),date,summary.getDeptCode(),orgCode);
if(valueSz != null){
value.setSz(valueSz.getSz());
value.setZxpl(valueSz.getZxpl());
valueSz = null;
}
} }
projType.setProject(values); projType.setProject(values);
} }
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
join SER_PROJ p on p.ID =v.PROJ_ID and p.STATE = 1 join SER_PROJ p on p.ID =v.PROJ_ID and p.STATE = 1
where 1=1 where 1=1
<if test="date!=null"> <if test="date!=null">
and v."DATE"=#{date} and v."DATE"=TO_NUMBER(SUBSTR(#{date,jdbcType=DECIMAL},1,4))
</if> </if>
<if test="budgetType!=null"> <if test="budgetType!=null">
and BitAnd(IS_BUDGET,#{budgetType})>0 and BitAnd(IS_BUDGET,#{budgetType})>0
......
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
AND v.DEPT_CODE = #{dept,jdbcType=VARCHAR} AND v.DEPT_CODE = #{dept,jdbcType=VARCHAR}
</if> </if>
<if test="date!=null"> <if test="date!=null">
AND v."DATE" = #{date,jdbcType=DECIMAL} AND v."DATE" = TO_NUMBER(SUBSTR(#{date,jdbcType=DECIMAL},1,4))
</if> </if>
<if test="hosCode!=null"> <if test="hosCode!=null">
AND v.HOSCODE = #{hosCode,jdbcType=VARCHAR} AND v.HOSCODE = #{hosCode,jdbcType=VARCHAR}
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
AND v.DEPT_CODE = #{dept,jdbcType=VARCHAR} AND v.DEPT_CODE = #{dept,jdbcType=VARCHAR}
</if> </if>
<if test="date!=null"> <if test="date!=null">
AND v."DATE" = #{date,jdbcType=DECIMAL} AND v."DATE" = TO_NUMBER(SUBSTR(#{date,jdbcType=DECIMAL},1,4))
</if> </if>
<if test="hosCode!=null"> <if test="hosCode!=null">
AND v.HOSCODE = #{hosCode,jdbcType=VARCHAR} AND v.HOSCODE = #{hosCode,jdbcType=VARCHAR}
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
select * select *
from SER_PROJ_VALUE_SZ from SER_PROJ_VALUE_SZ
where STATE = 1 and PROJ_ID = #{projId,jdbcType=DECIMAL} where STATE = 1 and PROJ_ID = #{projId,jdbcType=DECIMAL}
and TO_NUMBER(SUBSTR("DATE", 1, 4)) = #{date,jdbcType=DECIMAL} and "DATE" = #{date,jdbcType=DECIMAL}
and DEPT_CODE = #{deptCode,jdbcType=VARCHAR} and HOSCODE = #{hosCode,jdbcType=VARCHAR} and DEPT_CODE = #{deptCode,jdbcType=VARCHAR} and HOSCODE = #{hosCode,jdbcType=VARCHAR}
order by "DATE" desc order by "DATE" desc
</select> </select>
......
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