update code

dev_xds
haha 2024-04-20 22:29:34 +08:00
parent 694b343fcb
commit 7df7c1eb5a
7 changed files with 258 additions and 16 deletions

View File

@ -1,8 +1,10 @@
package com.yanzhu.jh.bigscreen.web.controller; package com.yanzhu.jh.bigscreen.web.controller;
import com.ruoyi.common.constant.Constants; import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.sign.Md5Utils; import com.ruoyi.common.utils.sign.Md5Utils;
import com.yanzhu.jh.project.domain.SurProjectCostOutput; import com.yanzhu.jh.project.domain.SurProjectCostOutput;
import com.yanzhu.jh.project.service.ISurProjectCostOutputService; import com.yanzhu.jh.project.service.ISurProjectCostOutputService;
@ -11,11 +13,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@RestController @RestController
@RequestMapping("/bgscreen/costOut") @RequestMapping("/bgscreen/costOut")
public class ProjectCostOutputController { public class ProjectCostOutputController extends BaseController {
@Autowired @Autowired
private RedisCache redisCache; private RedisCache redisCache;
@ -54,5 +57,38 @@ public class ProjectCostOutputController {
return AjaxResult.success(list); return AjaxResult.success(list);
} }
/**
*
* @param where
* @return
*/
@PostMapping("/sumForBsEnginAuditing")
public AjaxResult sumForBsEnginAuditing(@RequestBody SurProjectCostOutput where){
Long deptId=where.getId();
if(deptId==null||deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
List<SurProjectCostOutput> list=surProjectCostOutputService.sumForBsEnginAuditing(where);
return AjaxResult.success(list);
}
/**
* ,
* @param where
* @return
*/
@PostMapping("/selectForBigEnginList")
public AjaxResult selectForBigEnginList(@RequestBody SurProjectCostOutput where){
Long deptId=where.getId();
if(deptId==null||deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
Map<String,List<List<SurProjectCostOutput>>> list=surProjectCostOutputService.selectForBigEnginList(where);
return AjaxResult.success(list);
}
} }

View File

@ -63,4 +63,19 @@ public interface SurProjectCostOutputMapper
public List<SurProjectCostOutput> selectYearAndMonth(SurProjectCostOutput where); public List<SurProjectCostOutput> selectYearAndMonth(SurProjectCostOutput where);
List<SurProjectCostOutput> sumByDeptId(SurProjectCostOutput where); List<SurProjectCostOutput> sumByDeptId(SurProjectCostOutput where);
/**
*
* @param where
* @return
*/
public List<SurProjectCostOutput> sumForBsEnginAuditing(SurProjectCostOutput where);
/**
* ,
* @param where
* @return
*/
public List<SurProjectCostOutput> selectForBigEnginList(SurProjectCostOutput where);
} }

View File

@ -3,6 +3,7 @@ package com.yanzhu.jh.project.service;
import com.yanzhu.jh.project.domain.SurProjectCostOutput; import com.yanzhu.jh.project.domain.SurProjectCostOutput;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* Service * Service
@ -80,4 +81,17 @@ public interface ISurProjectCostOutputService
* @return * @return
*/ */
public int batchUpdate(List<SurProjectCostOutput> list); public int batchUpdate(List<SurProjectCostOutput> list);
/**
*
* @param where
* @return
*/
public List<SurProjectCostOutput> sumForBsEnginAuditing(SurProjectCostOutput where);
/**
* ,
* @param where
* @return
*/
public Map<String,List<List<SurProjectCostOutput>>> selectForBigEnginList(SurProjectCostOutput where);
} }

View File

@ -1,9 +1,6 @@
package com.yanzhu.jh.project.service.impl; package com.yanzhu.jh.project.service.impl;
import java.util.ArrayList; import java.util.*;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
@ -173,6 +170,7 @@ public class SurProjectCostOutputServiceImpl implements ISurProjectCostOutputSer
@Override @Override
public int batchUpdate(List<SurProjectCostOutput> list) { public int batchUpdate(List<SurProjectCostOutput> list) {
SurProjectCostOutput where=new SurProjectCostOutput(); SurProjectCostOutput where=new SurProjectCostOutput();
where.setProjectId(list.get(0).getProjectId());
where.setCostType(11l);//工程进度款支付 where.setCostType(11l);//工程进度款支付
List<SurProjectCostOutput> contractList=selectSurProjectCostOutputList(where); List<SurProjectCostOutput> contractList=selectSurProjectCostOutputList(where);
where.setCostType(12l);//安措费支付明细 where.setCostType(12l);//安措费支付明细
@ -204,5 +202,48 @@ public class SurProjectCostOutputServiceImpl implements ISurProjectCostOutputSer
} }
return list.size(); return list.size();
} }
/**
*
* @param where
* @return
*/
@Override
public List<SurProjectCostOutput> sumForBsEnginAuditing(SurProjectCostOutput where) {
return surProjectCostOutputMapper.sumForBsEnginAuditing(where);
}
/**
*
* @param where
* @return
*/
@Override
public Map<String,List<List<SurProjectCostOutput>>> selectForBigEnginList(SurProjectCostOutput where) {
List<SurProjectCostOutput> list=surProjectCostOutputMapper.selectForBigEnginList(where);
Map<String,List<List<SurProjectCostOutput>>> map=new HashMap<>();
List<SurProjectCostOutput> list11;//=new ArrayList<>();
List<SurProjectCostOutput> list12;//=new ArrayList<>();
List<List<SurProjectCostOutput>> plist;
for(SurProjectCostOutput it:list){
String pname=it.getRemark();
if(!map.containsKey(pname)){
list12=new ArrayList<>();
list11=new ArrayList<>();
plist=new ArrayList<>();
plist.add(list12);
plist.add(list11);
map.put(pname,plist);
}
plist=map.get(pname);
list12=plist.get(0);
list11=plist.get(1);
if(it.getCostType().equals(12l)){
list12.add(it);
}else{
list11.add(it);
}
}
return map;
}
} }

View File

@ -138,8 +138,8 @@ public class AttendanceJgwTask {
String appid="6a6f24fe35b04ee0bcf31cfb46ed1051"; String appid="6a6f24fe35b04ee0bcf31cfb46ed1051";
String secret="c3h5enh4MjAyNHN1Yw=="; String secret="c3h5enh4MjAyNHN1Yw==";
//String prjId="db955e11ef774e63968a47c3dc2acc15";//"b67f1baa6dca4558a16bf90a4681b82e";// //String prjId="db955e11ef774e63968a47c3dc2acc15";//"b67f1baa6dca4558a16bf90a4681b82e";//
String prjId="fa0a3e017ead4d4aa31eeb0ab6e4eda9";//泾河新城荟锦坊二期 String prjId="cace2f676371427e8f6da20d2924f64e";//泾河新城荟锦坊二期
String phone="17697358473"; String phone="15619028761";
String token= getToken(appid,secret); String token= getToken(appid,secret);
if(token==null || token.length()==0){ if(token==null || token.length()==0){
return; return;
@ -147,16 +147,16 @@ public class AttendanceJgwTask {
System.out.println(token); System.out.println(token);
System.out.println(DateUtil.format(DateTime.now(),"yyyy-MM-dd")); System.out.println(DateUtil.format(DateTime.now(),"yyyy-MM-dd"));
String subcontractorId=new AttendanceJgwTask().getSubcontractor(appid,token,phone); String subcontractorId=new AttendanceJgwTask().getSubcontractor(appid,token,phone);
String leaderTeamId="9a7cda9fd629495b8acc615a54c00625"; String leaderTeamId="b3774a8cd04c418dabf36bffbf276661";
System.out.println(subcontractorId); System.out.println(subcontractorId);
//findWorkerByLeader(appid,token,leaderTeamId); //findWorkerByLeader(appid,token,leaderTeamId);
//findDirectlyUnderTeam(appid,token,prjId,subcontractorId,0); //findDirectlyUnderTeam(appid,token,prjId,subcontractorId,0);
//queryProject(appid,token,phone,0);; //queryProject(appid,token,phone,0);;
//findAddWorkerByProject(appid,token,prjId,0); //findAddWorkerByProject(appid,token,prjId,0);
//findUpdateWorkerByProject(appid,token,prjId,0); //findUpdateWorkerByProject(appid,token,prjId,0);
findAttendanceByProject(appid,token,prjId,"0"); //findAttendanceByProject(appid,token,prjId,"0");
//findTeamByProjectId(appid,token,prjId); //findTeamByProjectId(appid,token,prjId);
//findProContractorByProjectId(appid,token,prjId); findProContractorByProjectId(appid,token,prjId);
//getJobTypeData(appid,token,"0"); //getJobTypeData(appid,token,"0");
//findDirectlyUnderTeam(appid,token,prjId); //findDirectlyUnderTeam(appid,token,prjId);
} }
@ -385,7 +385,12 @@ public class AttendanceJgwTask {
JSONObject j= JSON.parseObject(data); JSONObject j= JSON.parseObject(data);
JSONObject jd=j.getJSONObject("data"); JSONObject jd=j.getJSONObject("data");
JSONArray arr=jd.getJSONArray("recordList"); JSONArray arr=jd.getJSONArray("recordList");
JSONObject jo=arr.getJSONObject(0); for(int i=0;i<arr.size();i++){
JSONObject json=arr.getJSONObject(i);
if(json.getString("workerid").equals("56141214ea304fcc95a8098d3bafed0d")){
System.out.println("---1--");
}
}
} }
public static void findProContractorByProjectId(String appId,String token,String projectId){ public static void findProContractorByProjectId(String appId,String token,String projectId){
String path="/webapi/project/findProContractorByProjectId"; String path="/webapi/project/findProContractorByProjectId";
@ -420,7 +425,7 @@ public class AttendanceJgwTask {
public static void findTeamByProjectId(String appId,String token,String projectId){ public static void findTeamByProjectId(String appId,String token,String projectId){
String path="webapi/project/findTeamByProjectId"; String path="webapi/project/findTeamByProjectId";
String time = System.currentTimeMillis() + ""; String time = System.currentTimeMillis() + "";
String startId="100"; String startId="0";
String url=host+path+"?appId=" + appId + "&tokenSign=" + token +"&timestamp=" + time; String url=host+path+"?appId=" + appId + "&tokenSign=" + token +"&timestamp=" + time;
String tokenSign = Md5Utils.hash(url); String tokenSign = Md5Utils.hash(url);
@ -586,14 +591,14 @@ public class AttendanceJgwTask {
cnt++; cnt++;
} }
SurProjectAttendanceUser user=SurProjectAttendanceUser.createFromJgw(json); SurProjectAttendanceUser user=SurProjectAttendanceUser.createFromJgw(json);
if(user.getName().equals("赵峰")){ if(user.getName().equals("唐红吉")){
String k=user.getName(); String k=user.getName();
JSONArray arr2= json.getJSONArray("corpName"); JSONArray arr2= json.getJSONArray("corpName");
Object o=arr2.get(0); Object o=arr2.get(0);
} }
} }
System.out.println("cnt:"+cnt+","+arr.size()); System.out.println("cnt:"+cnt+","+arr.size());
//findAddWorkerByProject(appId, token, projectId, endId); findAddWorkerByProject(appId, token, projectId, endId);
} }
} }
public static void findUpdateWorkerByProject(String appId,String token,String projectId,int startId){ public static void findUpdateWorkerByProject(String appId,String token,String projectId,int startId){

View File

@ -135,6 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="projectId!=null and projectId>0"> <if test="projectId!=null and projectId>0">
and spco.project_id=#{projectId} and spco.project_id=#{projectId}
</if> </if>
UNION UNION
SELECT 2 cost_type , SUM(spco.money) money FROM sur_project_cost_output spco SELECT 2 cost_type , SUM(spco.money) money FROM sur_project_cost_output spco
@ -160,4 +161,132 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="sumForBsEnginAuditing" parameterType="SurProjectCostOutput" resultMap="SurProjectCostOutputResult">
select 1 cost_type,sum(money) money,'合同总金额' remark
from sur_project_cost_output a,sur_project sp
where a.project_id=sp.id and a.cost_type=3
and sp.isDel=0 and sp.progressVisible=0
<if test="id!=null and id>0"> and sp.deptId = #{id}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="projectId!=null and projectId>0">
and a.project_id=#{projectId}
</if>
<if test="prjIds !=null and prjIds.size()>0">
and a.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
union
SELECT 2 cost_type,SUM(money) money,'建安费总金额' remark
FROM sur_project_cost_output a,sur_project sp
WHERE a.project_id=sp.id AND a.cost_type=10
and sp.isDel=0 and sp.progressVisible=0
<if test="id!=null and id>0"> and sp.deptId = #{id}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="projectId!=null and projectId>0">
and a.project_id=#{projectId}
</if>
<if test="prjIds !=null and prjIds.size()>0">
and a.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
union
SELECT 3 cost_type,SUM(money2) money,'总计付款' remark
FROM sur_project_cost_output a,sur_project sp
WHERE a.project_id=sp.id AND a.cost_type in (11,12)
and sp.isDel=0 and sp.progressVisible=0
<if test="id!=null and id>0"> and sp.deptId = #{id}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="projectId!=null and projectId>0">
and a.project_id=#{projectId}
</if>
<if test="prjIds !=null and prjIds.size()>0">
and a.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
union
SELECT 4 cost_type,SUM(money2) money,'进度款已支付' remark
FROM sur_project_cost_output a,sur_project sp
WHERE a.project_id=sp.id AND a.cost_type in (11)
and sp.isDel=0 and sp.progressVisible=0
<if test="id!=null and id>0"> and sp.deptId = #{id}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="projectId!=null and projectId>0">
and a.project_id=#{projectId}
</if>
<if test="prjIds !=null and prjIds.size()>0">
and a.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
union
SELECT 5 cost_type,SUM(money2) money,'安措费已支付' remark
FROM sur_project_cost_output a,sur_project sp
WHERE a.project_id=sp.id AND a.cost_type IN (12)
and sp.isDel=0 and sp.progressVisible=0
<if test="id!=null and id>0"> and sp.deptId = #{id}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="projectId!=null and projectId>0">
and a.project_id=#{projectId}
</if>
<if test="prjIds !=null and prjIds.size()>0">
and a.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
union
SELECT 6 cost_type,SUM(money-money2) money,'挂账总金额' remark
FROM sur_project_cost_output a,sur_project sp
WHERE a.project_id=sp.id AND a.cost_type IN (11,12)
and sp.isDel=0 and sp.progressVisible=0
<if test="id!=null and id>0"> and sp.deptId = #{id}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="projectId!=null and projectId>0">
and a.project_id=#{projectId}
</if>
<if test="prjIds !=null and prjIds.size()>0">
and a.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</select>
<select id="selectForBigEnginList" parameterType="SurProjectCostOutput" resultMap="SurProjectCostOutputResult">
SELECT a.id, a.project_id, a.money, a.year, a.month, a.cost_type, sp.projectName remark, a.is_del, a.create_by, a.create_time, a.update_by, a.update_time,a.money2,a.date1,a.date2
FROM sur_project_cost_output a,sur_project sp
WHERE a.project_id=sp.id AND a.cost_type IN (11,12)
and sp.isDel=0 and sp.progressVisible=0
<if test="id!=null and id>0"> and sp.deptId = #{id}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="projectId!=null and projectId>0">
and a.project_id=#{projectId}
</if>
<if test="prjIds !=null and prjIds.size()>0">
and a.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
ORDER BY a.create_time
</select>
</mapper> </mapper>

View File

@ -311,7 +311,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="id==1">SUM(c.totalInvestment)</if> <if test="id==1">SUM(c.totalInvestment)</if>
<if test="id==2">COUNT(1)*10000</if> <if test="id==2">COUNT(1)*10000</if>
cnt FROM sur_project a, sys_dict_data b,vw_sur_project_cost_output c WHERE b.dict_type='project_category' AND a.id=c.project_id cnt FROM sur_project a, sys_dict_data b,vw_sur_project_cost_output c WHERE b.dict_type='project_category' AND a.id=c.project_id
AND a.projectType=b.dict_value and a.isDel=0 and a.progressVisible=0 AND a.projectType=b.dict_value and a.isDel=0
<if test="id!=0"> and a.progressVisible=0</if>
<if test="deptId>0">AND deptid=#{deptId}</if> <if test="deptId>0">AND deptid=#{deptId}</if>
<if test="proType != null and proType != ''"> and projectType = #{proType}</if> <if test="proType != null and proType != ''"> and projectType = #{proType}</if>
GROUP BY dict_value,dict_label GROUP BY dict_value,dict_label
@ -337,7 +338,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="id==1">SUM(c.totalInvestment)</if> <if test="id==1">SUM(c.totalInvestment)</if>
cnt FROM sur_project a, sys_dict_data b ,vw_sur_project_cost_output c WHERE b.dict_type='project_level' AND a.id=c.project_id cnt FROM sur_project a, sys_dict_data b ,vw_sur_project_cost_output c WHERE b.dict_type='project_level' AND a.id=c.project_id
AND a.projiectLevel=b.dict_value and a.isDel=0 and a.progressVisible=0 AND a.projiectLevel=b.dict_value and a.isDel=0
<if test="id!=0"> and a.progressVisible=0</if>
<if test="deptId>0">AND deptid=#{deptId}</if> <if test="deptId>0">AND deptid=#{deptId}</if>
<if test="proType != null and proType != ''"> and projectType = #{proType}</if> <if test="proType != null and proType != ''"> and projectType = #{proType}</if>
GROUP BY dict_value,dict_label GROUP BY dict_value,dict_label