Commit 9b178a8b by wangqi

云端三基

parent d2aa2175
......@@ -7,10 +7,7 @@ import com.qianhe.common.core.domain.entity.SysDictData;
import com.qianhe.common.core.domain.entity.SysDictType;
import com.qianhe.common.core.page.TableDataInfo;
import com.qianhe.domain.*;
import com.qianhe.service.IJygxBmjjService;
import com.qianhe.service.IJygxCljwhService;
import com.qianhe.service.IJygxWzglService;
import com.qianhe.service.IJygxYyxtwhService;
import com.qianhe.service.*;
import com.qianhe.system.service.ISysDictDataService;
import com.qianhe.system.service.ISysDictTypeService;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -156,5 +153,22 @@ public class JygxSyController extends BaseController
}
@Autowired
private ISjZdscService sjZdscService;
/**
* 查询基层三册列表
*/
@GetMapping("/wjsc")
public TableDataInfo list(SjZdsc sjZdsc)
{
startPage();
sjZdsc.setZt("1");
sjZdsc.setGxqx("公开");
List<SjZdsc> list = sjZdscService.selectSjZdscList_gk(sjZdsc);
return getDataTable(list);
}
}
......@@ -606,6 +606,9 @@ public class SjFybpZbController extends BaseController
cb1.setFylx("三基标杆打造");
//项目金额
String fyje1 = new DataFormatter().formatCellValue(row.getCell(3));
if (null == fyje1 || fyje1.trim().isEmpty()) {
fyje1="0";
}
cb1.setFyje(new BigDecimal(fyje1));
//项目内容
String fyms1 = new DataFormatter().formatCellValue(row.getCell(4));
......@@ -616,6 +619,9 @@ public class SjFybpZbController extends BaseController
cb2.setFylx("三个最强全员练兵");
//项目金额
String fyje2 = new DataFormatter().formatCellValue(row.getCell(5));
if (null == fyje2 || fyje2.trim().isEmpty()) {
fyje2="0";
}
cb2.setFyje(new BigDecimal(fyje2));
//项目内容
String fyms2 = new DataFormatter().formatCellValue(row.getCell(6));
......@@ -626,6 +632,9 @@ public class SjFybpZbController extends BaseController
cb3.setFylx("三标建设5S管理");
//项目金额
String fyje3 = new DataFormatter().formatCellValue(row.getCell(7));
if (null == fyje3 || fyje3.trim().isEmpty()) {
fyje3="0";
}
cb3.setFyje(new BigDecimal(fyje3));
//项目内容
String fyms3 = new DataFormatter().formatCellValue(row.getCell(8));
......@@ -636,6 +645,9 @@ public class SjFybpZbController extends BaseController
cb4.setFylx("基层班站建设");
//项目金额
String fyje4 = new DataFormatter().formatCellValue(row.getCell(9));
if (null == fyje4 || fyje4.trim().isEmpty()) {
fyje4="0";
}
cb4.setFyje(new BigDecimal(fyje4));
//项目内容
String fyms4 = new DataFormatter().formatCellValue(row.getCell(10));
......@@ -646,6 +658,9 @@ public class SjFybpZbController extends BaseController
cb5.setFylx("其他");
//项目金额
String fyje5 = new DataFormatter().formatCellValue(row.getCell(11));
if (null == fyje5 || fyje5.trim().isEmpty()) {
fyje5="0";
}
cb5.setFyje(new BigDecimal(fyje5));
//项目内容
String fyms5 = new DataFormatter().formatCellValue(row.getCell(12));
......
package com.qianhe.controller;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeParseException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -100,6 +103,9 @@ public class SjGfjsXjbzController extends BaseController
}
}
if(isBeforeNextYearFeb1(nd)){
sjGfjsXjbzService.updateBzxx_xjbz(nd);
}
list = sjGfjsXjbzService.selectSjGfjsXjbzList(sjGfjsXjbz);
map.put("code", HttpStatus.SUCCESS);
......@@ -108,6 +114,31 @@ public class SjGfjsXjbzController extends BaseController
return map;
}
public static boolean isBeforeNextYearFeb1(String inputYear) {
// 1. 校验输入年份的合法性(必须是4位数字)
if (inputYear == null || !inputYear.matches("^\\d{4}$")) {
throw new IllegalArgumentException("输入年度必须是4位数字(如2025),当前输入:" + inputYear);
}
try {
// 2. 解析输入年份,计算次年2月1日00:00:00(东八区时区,避免系统时区偏差)
int year = Integer.parseInt(inputYear);
int nextYear = year + 1;
// 构建次年2月1日0点的截止时间(指定东八区)
LocalDateTime nextFeb1 = LocalDateTime.of(nextYear, 2, 1, 0, 0, 0)
.atZone(ZoneId.of("Asia/Shanghai"))
.toLocalDateTime();
// 3. 获取当前东八区时间,对比是否在截止时间之前
LocalDateTime now = LocalDateTime.now(ZoneId.of("Asia/Shanghai"));
return now.isBefore(nextFeb1);
} catch (NumberFormatException | DateTimeParseException e) {
throw new IllegalArgumentException("年份解析失败:" + inputYear, e);
}
}
/**
* 导出三基 规范建设 星级班组列表
*/
......
......@@ -644,4 +644,15 @@ public class SjGfjsZsdwkhpjController extends BaseController
}
@PostMapping("/editFdjgzt")
public AjaxResult updateFdjg_zt(@RequestBody SjGfjsZsdwkhpjZb in)
{
String nd = in.getNd();
String zqfw = in.getZqfw();
Long deptId = in.getDeptId();
return toAjax(sjGfjsZsdwkhpjZbService.updateFdjg_zt(in));
}
}
......@@ -195,4 +195,10 @@ public class SjGfjsZsdwkhpjZb extends BaseEntity
private String fdjb;
private String qnpjqk;//去年 评价情况
/**
* 状态 1 已提交
*/
private String jgzt;
}
......@@ -70,4 +70,7 @@ public interface SjGfjsXjbzMapper
public int plxg(SjGfjsXjbz s);
public int updateBzxx_xjbz(String nd);
}
......@@ -66,4 +66,7 @@ public interface SjGfjsZsdwkhpjZbMapper
SjGfjsZsdwkhpjZb selectSjGfjsZsdwkhpjZb(SjGfjsZsdwkhpjZb sjGfjsZsdwkhpjZb);
public int updateFdjg_zt(SjGfjsZsdwkhpjZb sjGfjsZsdwkhpjZb);
}
......@@ -67,4 +67,7 @@ public interface ISjGfjsXjbzService
int pledit(List<SjGfjsXjbz> list);
public int plxg(SjGfjsXjbz s);
public int updateBzxx_xjbz(String nd);
}
......@@ -65,4 +65,7 @@ public interface ISjGfjsZsdwkhpjZbService
public int deleteSjGfjsZsdwkhpjZbById(Long id);
SjGfjsZsdwkhpjZb selectSjGfjsZsdwkhpjZb(SjGfjsZsdwkhpjZb sjGfjsZsdwkhpjZb);
public int updateFdjg_zt(SjGfjsZsdwkhpjZb sjGfjsZsdwkhpjZb);
}
......@@ -27,6 +27,7 @@ public interface ISjZdscService
* @return 基层三册集合
*/
public List<SjZdsc> selectSjZdscList(SjZdsc sjZdsc);
public List<SjZdsc> selectSjZdscList_gk(SjZdsc sjZdsc);
public List<SjZdsc> gxList(SjZdsc sjZdsc);
public List<SjZdsc> gxgkList(SjZdsc sjZdsc);
......
......@@ -13,6 +13,9 @@ import com.qianhe.mapper.WdWdxxMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Objects;
import java.util.Optional;
import com.qianhe.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import com.qianhe.domain.SjFybp;
......@@ -94,6 +97,14 @@ public class SjFybpZbServiceImpl implements ISjFybpZbService
//保存金额
if(StringUtils.isNotEmpty(sjFybpZb.getSjFybpList())){
for (SjFybp sjFybp : sjFybpZb.getSjFybpList()) {
// 5. 给fyje赋值:如果getFyje()为空,赋值为0
BigDecimal fyje = sjFybp.getFyje();
if (Objects.isNull(fyje)) {
sjFybp.setFyje(BigDecimal.ZERO); // 空则赋值为0
}
}
//统计已结算金额
BigDecimal reduce = sjFybpZb.getSjFybpList().stream().map(SjFybp::getFyje).reduce(BigDecimal.ZERO, BigDecimal::add);
sjFybpZb.setFyje(reduce);
......@@ -142,6 +153,14 @@ public class SjFybpZbServiceImpl implements ISjFybpZbService
}
//保存金额
if(StringUtils.isNotEmpty(sjFybpZb.getSjFybpList())){
for (SjFybp sjFybp : sjFybpZb.getSjFybpList()) {
// 5. 给fyje赋值:如果getFyje()为空,赋值为0
BigDecimal fyje = sjFybp.getFyje();
if (Objects.isNull(fyje)) {
sjFybp.setFyje(BigDecimal.ZERO); // 空则赋值为0
}
}
//统计已结算金额
BigDecimal reduce = sjFybpZb.getSjFybpList().stream().map(SjFybp::getFyje).reduce(BigDecimal.ZERO, BigDecimal::add);
sjFybpZb.setFyje(reduce);
......
......@@ -112,4 +112,11 @@ public class SjGfjsXjbzServiceImpl implements ISjGfjsXjbzService
{
return sjGfjsXjbzMapper.plxg(s);
}
@Override
public int updateBzxx_xjbz(String nd)
{
return sjGfjsXjbzMapper.updateBzxx_xjbz(nd);
}
}
......@@ -115,4 +115,10 @@ public class SjGfjsZsdwkhpjZbServiceImpl implements ISjGfjsZsdwkhpjZbService
public SjGfjsZsdwkhpjZb selectSjGfjsZsdwkhpjZb(SjGfjsZsdwkhpjZb sjGfjsZsdwkhpjZb) {
return sjGfjsZsdwkhpjZbMapper.selectSjGfjsZsdwkhpjZb(sjGfjsZsdwkhpjZb);
}
@Override
public int updateFdjg_zt(SjGfjsZsdwkhpjZb sjGfjsZsdwkhpjZb)
{
return sjGfjsZsdwkhpjZbMapper.updateFdjg_zt(sjGfjsZsdwkhpjZb);
}
}
......@@ -84,6 +84,38 @@ public class SjZdscServiceImpl implements ISjZdscService
return rl;
}
/**
* 查询基层三册列表
*
* @param sjZdsc 基层三册
* @return 基层三册
*/
@Override
public List<SjZdsc> selectSjZdscList_gk(SjZdsc sjZdsc)
{
List<SjZdsc> rl = sjZdscMapper.selectSjZdscList(sjZdsc);
//查询附件
List<GgFjb> fjlistAll = fjbService.selectFjByMk("基层三册");
for(SjZdsc rt:rl){
Long id = rt.getId();
String ids = String.valueOf(id);
List<GgFjb> fjlist = fjlistAll.stream().filter(e->e.getYWID().equals(ids)).collect(Collectors.toList());
Map<String, List<GgFjb>> map = fjlist.stream().collect(Collectors.groupingBy(GgFjb::getFJLX));
if(map.get("基层三册")!=null){
List<GgFjb> fileData = map.get("基层三册").stream().collect(Collectors.toList());
rt.setFileList1(fileData);
}
}
return rl;
}
/**
* 新增基层三册
*
......
......@@ -164,8 +164,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fymc != null and fymc != ''"> and b.fymc like concat('%', #{fymc}, '%')</if>
<if test="fyrq != null and fyrq != ''"> and a.fyrq = #{fyrq}</if>
${params.dataScope}
and b.fyje != 0
group by a.id,a.dept_id,d.dept_name,a.fyrq,a.fyje,b.id,b.fymc,b.fylx,b.fyje,b.fyms
order by a.sprq desc
order by a.sprq desc,a.dept_id,b.id
</select>
<select id="getFygzById" resultMap="SjFybpResult">
select a.id zb_id,a.dept_id,d.dept_name,a.fyrq,a.fyje fyzje,b.id,b.fymc,b.fylx,b.fyje,b.fyms,IFNULL(sum(c.syje),0) ysyje from sj_fybp_zb a
......
......@@ -53,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="zt" column="zt" />
<result property="fdjb" column="fdjb" />
<result property="qnpjqk" column="qnpjqk" />
<result property="jgzt" column="jgzt" />
</resultMap>
<sql id="selectSjGfjsZsdwkhpjZbVo">
......@@ -96,7 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
yl2,
yl3,
yl4,
yl5,d.dept_name,p.dept_name parent_name, a.pm, a.zt,a.fdjb,
yl5,d.dept_name,p.dept_name parent_name, a.pm, a.zt,a.fdjb,a.jgzt,
( select pjqk from sj_nd_dwpjqk q
WHERE q.dept_id = a.dept_id and q.nd = a.nd-1 order by q.nd desc limit 1 ) qnpjqk
from sj_gfjs_zsdwkhpj_zb a
......@@ -417,4 +418,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
order by p.order_num, a.pm,a.zhdf desc
</select>
<update id="updateFdjg_zt" parameterType="SjGfjsZsdwkhpjZb">
update sj_gfjs_zsdwkhpj_zb set jgzt = '1'
where nd = #{nd} and zqfw = #{zqfw} and jb = '直属单位'
and dept_id in (select dept_id from sys_dept where FIND_IN_SET (#{deptId},ancestors) )
</update>
</mapper>
......@@ -174,4 +174,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
where FIND_IN_SET(id, #{ids})
</update>
<update id="updateBzxx_xjbz" parameterType="String">
delete
from sj_gfjs_xjbz
where bz_id not in ( select id from sj_bzxx b )
and nd =#{nd} ;
INSERT INTO sj_gfjs_xjbz (bz_id, dept_id, nd, bzlx, bzmc, fdjb)
select id, dept_id, #{nd} nd, bzlx, bzmc, rs
from sj_bzxx b
where b.id not in ( select bz_id from sj_gfjs_xjbz where nd =#{nd} )
;
update sj_gfjs_xjbz x
left join sj_bzxx b on b.id = x.bz_id
set x.bzlx = b.bzlx, x.bzmc = b.bzmc, x.fdjb = b.rs
where x.nd =#{nd};
</update>
</mapper>
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