看板中日程

master
董哲奇 7 months ago
parent d8af6a7619
commit 27a0149945

@ -1,7 +1,6 @@
package com.dsic.gj_erp.controller.kban;
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@ -10,12 +9,6 @@ import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.resource.ResourceUtil;
import cn.hutool.core.util.StrUtil;
import com.dsic.gj_erp.bean.jcsj.DmCbxxp;
import com.dsic.gj_erp.service.jcsj.DmBomService;
import com.dsic.gj_erp.service.jcsj.DmCbxxpService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -35,7 +28,9 @@ import com.dsic.gj_erp.service.zyjh.ZyjhService;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
/**
@ -59,6 +54,13 @@ public class KbanController {
private final SyMsgService msgService;
private final DmSygdMxService service;
/**
*
*/
@GetMapping("/zrcTable")
public ResultBean<?> zrcTable() {
return new ResultBean<>(kbanService.zrcTable());
}
/**
*

@ -1,5 +1,6 @@
package com.dsic.gj_erp.mapper;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@ -47,4 +48,18 @@ public interface KbanMapper {
Map<String, Object> todayZyjhzx(String from, String to);
List<Map<String, Object>> xbgtt(String nf);
List<Map<String, Object>> zrcpcsl(String from, String to);
Integer tzsl(String from, String to);
Integer ltsl(String from, String to);
BigDecimal xqzl(String from, String to);
BigDecimal dhzl(String from, String to);
BigDecimal jhzl(String from, String to);
BigDecimal wczl(String from, String to);
}

@ -1,5 +1,6 @@
package com.dsic.gj_erp.service;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@ -21,6 +22,29 @@ public class KbanService {
private final KbanMapper kbanMapper;
public Map<String, Object> zrcTable() {
DateTime date = DateUtil.date();
String from = DateUtil.beginOfMonth(date).toString("yyyy/MM/dd");
String to = DateUtil.endOfMonth(date).toString("yyyy/MM/dd");
List<Map<String, Object>> zrcpcsl=kbanMapper.zrcpcsl(from, to);
Integer ltsl=kbanMapper.ltsl(from, to);
Integer tzsl = kbanMapper.tzsl(from, to);
BigDecimal xqzl=kbanMapper.xqzl(from, to);
BigDecimal dhzl = kbanMapper.dhzl(from, to);
BigDecimal jhzl = kbanMapper.jhzl(from, to);
BigDecimal wczl = kbanMapper.wczl(from, to);
Map<String,Object> map=new HashMap<>();
map.put("detail", zrcpcsl);
map.put("ltsl", ltsl);
map.put("tzsl", tzsl);
map.put("xqzl", xqzl);
map.put("dhzl", dhzl);
map.put("jhzl", jhzl);
map.put("wczl", wczl);
return map;
}
public List<Map<String, Object>> getProjects() {
return kbanMapper.getProjects();
}
@ -37,7 +61,6 @@ public class KbanService {
List<Map<String,Object>> detail=kbanMapper.zxqZxDetail(date.toString("yyyy/MM/dd"));
map.put("detail", detail);
return map;
}
public List<Map<String, Object>> zyjhzx() {

@ -129,8 +129,9 @@
SELECT
DISTINCT xq.dc_ch ,
sum(xq.dzjz) over(PARTITION by xq.dc_ch) xqzl ,
SUM(CONVERT( decimal, isnull(ydjh.zl,'0'))) over(PARTITION by xq.dc_ch) jhzl ,
SUM(CONVERT( decimal, case when ydjh.zt>=62 then ydjh.zl else '0' end)) over(PARTITION by xq.dc_ch) wczl
SUM(CONVERT( decimal, isnull(ydjh.bclqzl,'0'))) over(PARTITION by xq.dc_ch) jhzl ,
SUM(CONVERT( decimal, case when ydjh.zt>=62 then ydjh.bclqzl else '0' end)) over(PARTITION
by xq.dc_ch) wczl
from
dm_qfxq xq left join dm_ydjh ydjh on xq.dc_ch =ydjh.dc_ch and xq.dc_pl =ydjh.dc_pl
where
@ -139,7 +140,7 @@
<select id="zyjh" resultType="java.util.Map">
SELECT
sum(CONVERT( decimal, isnull(zl,'0'))/1000) jh,
sum(CONVERT( decimal, isnull(bclqzl,'0'))/1000) jh,
count(1) zs,
sum(case when zt>11 then 1 else 0 end) sl
from
@ -163,7 +164,7 @@
from
dm_ydjh
WHERE
zt >=62 and jssj BETWEEN '#{from} and #{to} and (SUBSTRING(tzbh,6,1)='1' or
zt >=62 and jssj BETWEEN #{from} and #{to} and (SUBSTRING(tzbh,6,1)='1' or
SUBSTRING(tzbh,6,1)='3')
UNION ALL
SELECT
@ -196,12 +197,53 @@
<select id="xbgtt" resultType="java.util.Map">
SELECT
DISTINCT a.dc_ch dcCh,a.yf,sum(a.zl/1000) over(PARTITION by a.dc_ch,a.yf) zl ,
sum(CONVERT(decimal,b.zl)/1000) over(PARTITION by b.dc_ch,MONTH(CAST(b.jssj AS DATE))) jhzl
sum(CONVERT(decimal,b.bclqzl)/1000) over(PARTITION by b.dc_ch,MONTH(CAST(b.jssj AS DATE))) jhzl
from dm_xbjh a left join dm_ydjh b on a.dc_ch =b.dc_ch and
CONVERT(int,a.yf)=MONTH(CAST(b.jssj AS DATE)) WHERE a.nf=#{nf}
order by a.dc_ch, a.yf
</select>
<select id="getProjects" resultType="java.util.Map">
SELECT dcch dcCh,pl dcPl from (SELECT dcch ,pl ,ROW_NUMBER() over(PARTITION by dcch,pl order by dcch,pl) rn from dm_bom ) a where a.rn=1
</select>
<select id="zrcpcsl" resultType="java.util.Map">
SELECT
dc_ch dcCh,sum(t) total
from (
SELECT DC_CH , DC_PL ,1 t
from dm_zrcjh
where jssj_xz BETWEEN #{from} and #{to} group by DC_CH,DC_PL ) a group by dc_ch
</select>
<!-- 图纸数量 -->
<select id="tzsl" resultType="Integer">
SELECT sum(t) total from (SELECT DC_CH , DC_PL ,sum(1) t from dm_zrcjh where jssj_xz BETWEEN
#{from} and #{to} group by DC_CH,DC_PL ) a
</select>
<!-- 接收图纸数量 -->
<select id="ltsl" resultType="Integer">
SELECT sum(isnull(t,0)) total from (SELECT DC_CH , DC_PL ,sum(1) t from dm_zrcjh where jssj_xz BETWEEN
#{from} and #{to} and isnull(jsq_tlt,'')!='' group by DC_CH,DC_PL ) a
</select>
<select id="xqzl" resultType="BigDecimal">
SELECT SUM(isnull(b.bclqzl,0)/1000) from dm_zrcjh a left join dm_bom b on a.DC_CH =b.dcch
and a.DC_PL =b.pl and a.DC_FD =b.fd where a.jssj_xz BETWEEN #{from} and #{to}
</select>
<select id="dhzl" resultType="BigDecimal">
SELECT SUM(isnull(b.zzl ,0)/1000) from dm_zrcjh a left join Dm_dhqdp b on a.DC_CH =b.DC_CH
where a.jssj_xz BETWEEN #{from} and #{to}
</select>
<select id="jhzl" resultType="BigDecimal">
SELECT SUM(isnull(bclqzl,0)/1000) FROM dm_ydjh WHERE jssj BETWEEN #{from} and #{to}
</select>
<select id="wczl" resultType="BigDecimal">
SELECT SUM(case when zt>=62 then isnull(bclqzl,0)/1000 else 0 end) FROM dm_ydjh WHERE jssj
BETWEEN #{from} and #{to}
</select>
</mapper>

Loading…
Cancel
Save