Browse Source

预算及成本重构

master
陈裕财 4 years ago
parent
commit
3683d4471d
  1. 34
      xm-core/src/main/java/com/xm/core/ctrl/XmBudgetNlaborController.java
  2. 34
      xm-core/src/main/java/com/xm/core/ctrl/XmCostNlaborController.java
  3. 40
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmCostNlaborMapper.xml

34
xm-core/src/main/java/com/xm/core/ctrl/XmBudgetNlaborController.java

@ -1,36 +1,26 @@
package com.xm.core.ctrl; package com.xm.core.ctrl;
import java.util.*;
import java.util.stream.Collectors;
import com.mdp.core.entity.Tips;
import com.mdp.core.utils.RequestUtils;
import com.mdp.mybatis.PageUtils;
import com.mdp.swagger.ApiEntityParams;
import com.xm.core.entity.XmBudgetNlabor;
import com.xm.core.service.XmBudgetNlaborService;
import io.swagger.annotations.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import static com.mdp.core.utils.ResponseHelper.*;
import static com.mdp.core.utils.BaseUtils.*;
import com.mdp.core.entity.Tips;
import com.mdp.core.err.BizException;
import com.mdp.mybatis.PageUtils;
import com.mdp.core.utils.RequestUtils;
import com.mdp.core.utils.NumberUtil;
import com.mdp.safe.client.entity.User;
import com.mdp.safe.client.utils.LoginUtils;
import com.mdp.swagger.ApiEntityParams;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import com.xm.core.service.XmBudgetNlaborService;
import com.xm.core.entity.XmBudgetNlabor;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.mdp.core.utils.BaseUtils.toMap;
/** /**
* url编制采用rest风格,如对xm_budget_nlabor 项目人力成本预算的操作有增删改查,对应的url分别为:<br> * url编制采用rest风格,如对xm_budget_nlabor 项目人力成本预算的操作有增删改查,对应的url分别为:<br>

34
xm-core/src/main/java/com/xm/core/ctrl/XmCostNlaborController.java

@ -1,36 +1,26 @@
package com.xm.core.ctrl; package com.xm.core.ctrl;
import java.util.*;
import java.util.stream.Collectors;
import com.mdp.core.entity.Tips;
import com.mdp.core.utils.RequestUtils;
import com.mdp.mybatis.PageUtils;
import com.mdp.swagger.ApiEntityParams;
import com.xm.core.entity.XmCostNlabor;
import com.xm.core.service.XmCostNlaborService;
import io.swagger.annotations.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import static com.mdp.core.utils.ResponseHelper.*;
import static com.mdp.core.utils.BaseUtils.*;
import com.mdp.core.entity.Tips;
import com.mdp.core.err.BizException;
import com.mdp.mybatis.PageUtils;
import com.mdp.core.utils.RequestUtils;
import com.mdp.core.utils.NumberUtil;
import com.mdp.safe.client.entity.User;
import com.mdp.safe.client.utils.LoginUtils;
import com.mdp.swagger.ApiEntityParams;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import com.xm.core.service.XmCostNlaborService;
import com.xm.core.entity.XmCostNlabor;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.mdp.core.utils.BaseUtils.toMap;
/** /**
* url编制采用rest风格,如对xm_cost_nlabor 项目实际人工成本费用的操作有增删改查,对应的url分别为:<br> * url编制采用rest风格,如对xm_cost_nlabor 项目实际人工成本费用的操作有增删改查,对应的url分别为:<br>

40
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmCostNlaborMapper.xml

@ -13,7 +13,45 @@
</if> </if>
<if test="key != null and key !='' "> </if> <if test="key != null and key !='' "> </if>
</sql> </sql>
<!-- 查询非人力的支出及对应的项目的预算,非人力支出不能大于项目非人力总预算 -->
<select id="selectTotalProjectAndNouserActCost" parameterType="HashMap" resultType="HashMap">
SELECT
sum( ifnull(res.act_at,0) ) AS act_cost_nouser_amount,
p.plan_nouser_at,
p.plan_iuser_at,
p.plan_ouser_at,
p.locked,
p.plan_workload,
p.total_receivables,
p.budget_margin_rate,
p.contract_amt,
p.plan_iuser_price,
p.plan_ouser_price,
p.plan_ouser_cnt,
p.plan_iuser_cnt,
p.plan_working_hours
FROM
XM.xm_project p
LEFT JOIN xm_cost_nlabor res ON p.id = res.project_id
<where>
p.id = #{projectId}
<if test=" excludeIds !=null "> and res.id not in
<foreach collection="excludeIds" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
</where>
</select>
<!-- 通过条件查询获取数据列表 返回list<map> -->
<select id="listSum" parameterType="HashMap" resultType="HashMap">
select res.project_id,res.subject_id,res.subject_name,biz_month,sum(res.act_at) as act_at from xm_cost_nlabor res
<where>
and res.project_id=#{projectId}
<if test="subjectId != null and subjectId !='' "> and res.subject_id =#{subjectId} </if>
<if test="costType != null and costType !='' "> and res.cost_type =#{costType} </if>
</where>
group by res.project_id ,res.subject_id,res.subject_name,res.biz_month
</select>
<!--结束 自定义sql函数区域--> <!--结束 自定义sql函数区域-->

Loading…
Cancel
Save