Commit 383f5927 by jiang'yun

修改问题

parent 751612ab
package com.qianhe.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.qianhe.common.annotation.Log;
import com.qianhe.common.core.controller.BaseController;
import com.qianhe.common.core.domain.AjaxResult;
import com.qianhe.common.enums.BusinessType;
import com.qianhe.system.domain.SysDeptCb;
import com.qianhe.system.service.ISysDeptCbService;
import com.qianhe.common.utils.poi.ExcelUtil;
import com.qianhe.common.core.page.TableDataInfo;
/**
* 单位从Controller
*
* @author qianhe
* @date 2024-07-10
*/
@RestController
@RequestMapping("/system/sysDeptCb")
public class SysDeptCbController extends BaseController
{
@Autowired
private ISysDeptCbService sysDeptCbService;
/**
* 查询单位从列表
*/
@PreAuthorize("@ss.hasPermi('system:sysDeptCb:list')")
@GetMapping("/list")
public TableDataInfo list(SysDeptCb sysDeptCb)
{
startPage();
List<SysDeptCb> list = sysDeptCbService.selectSysDeptCbList(sysDeptCb);
return getDataTable(list);
}
/**
* 导出单位从列表
*/
@PreAuthorize("@ss.hasPermi('system:sysDeptCb:export')")
@Log(title = "单位从", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SysDeptCb sysDeptCb)
{
List<SysDeptCb> list = sysDeptCbService.selectSysDeptCbList(sysDeptCb);
ExcelUtil<SysDeptCb> util = new ExcelUtil<SysDeptCb>(SysDeptCb.class);
util.exportExcel(response, list, "单位从数据");
}
/**
* 获取单位从详细信息
*/
@PreAuthorize("@ss.hasPermi('system:sysDeptCb:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sysDeptCbService.selectSysDeptCbById(id));
}
/**
* 新增单位从
*/
@PreAuthorize("@ss.hasPermi('system:sysDeptCb:add')")
@Log(title = "单位从", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SysDeptCb sysDeptCb)
{
return toAjax(sysDeptCbService.insertSysDeptCb(sysDeptCb));
}
/**
* 修改单位从
*/
@PreAuthorize("@ss.hasPermi('system:sysDeptCb:edit')")
@Log(title = "单位从", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SysDeptCb sysDeptCb)
{
return toAjax(sysDeptCbService.updateSysDeptCb(sysDeptCb));
}
/**
* 删除单位从
*/
@PreAuthorize("@ss.hasPermi('system:sysDeptCb:remove')")
@Log(title = "单位从", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sysDeptCbService.deleteSysDeptCbByIds(ids));
}
/**
* 获取单位从详细信息
*/
@PreAuthorize("@ss.hasPermi('system:sysDeptCb:getInfoBydeptId')")
@GetMapping(value = "/getInfoBydeptId")
public AjaxResult getInfoBydeptId(SysDeptCb sysDeptCb)
{
return success(sysDeptCbService.getInfoBydeptId(sysDeptCb));
}
}
...@@ -115,6 +115,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter ...@@ -115,6 +115,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 静态资源,可匿名访问 // 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
.antMatchers("/system/sjFybpZb/**","/system/sjFybp/**").permitAll()
// 除上面外的所有请求全部需要鉴权认证 // 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated() .anyRequest().authenticated()
.and() .and()
......
package com.qianhe.system.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.qianhe.common.annotation.Excel;
import com.qianhe.common.core.domain.BaseEntity;
/**
* 单位从对象 sys_dept_cb
*
* @author qianhe
* @date 2024-07-10
*/
public class SysDeptCb extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 单位 */
@Excel(name = "单位")
private String deptId;
/** 年度 */
@Excel(name = "年度")
private String nd;
/** 单位类型(油气开发单位、主要专业化单位、科研、监督、服务协调单位) */
@Excel(name = "单位类型", readConverterExp = "油=气开发单位、主要专业化单位、科研、监督、服务协调单位")
private String dwlx;
/** 交油气量(万吨)/经营收入(万元) */
@Excel(name = "交油气量", readConverterExp = "万=吨")
private BigDecimal jyqlhjysr;
/** 基层人员数量 */
@Excel(name = "基层人员数量")
private Long jcrysl;
/** 基层单位数量 */
@Excel(name = "基层单位数量")
private Long jcdwsl;
/** 一线班站数量 */
@Excel(name = "一线班站数量")
private Long yxbzsl;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setDeptId(String deptId)
{
this.deptId = deptId;
}
public String getDeptId()
{
return deptId;
}
public void setNd(String nd)
{
this.nd = nd;
}
public String getNd()
{
return nd;
}
public void setDwlx(String dwlx)
{
this.dwlx = dwlx;
}
public String getDwlx()
{
return dwlx;
}
public void setJyqlhjysr(BigDecimal jyqlhjysr)
{
this.jyqlhjysr = jyqlhjysr;
}
public BigDecimal getJyqlhjysr()
{
return jyqlhjysr;
}
public void setJcrysl(Long jcrysl)
{
this.jcrysl = jcrysl;
}
public Long getJcrysl()
{
return jcrysl;
}
public void setJcdwsl(Long jcdwsl)
{
this.jcdwsl = jcdwsl;
}
public Long getJcdwsl()
{
return jcdwsl;
}
public void setYxbzsl(Long yxbzsl)
{
this.yxbzsl = yxbzsl;
}
public Long getYxbzsl()
{
return yxbzsl;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("deptId", getDeptId())
.append("nd", getNd())
.append("dwlx", getDwlx())
.append("jyqlhjysr", getJyqlhjysr())
.append("jcrysl", getJcrysl())
.append("jcdwsl", getJcdwsl())
.append("yxbzsl", getYxbzsl())
.toString();
}
}
package com.qianhe.system.mapper;
import java.util.List;
import com.qianhe.system.domain.SysDeptCb;
import org.apache.ibatis.annotations.Param;
/**
* 单位从Mapper接口
*
* @author qianhe
* @date 2024-07-10
*/
public interface SysDeptCbMapper
{
/**
* 查询单位从
*
* @param id 单位从主键
* @return 单位从
*/
public SysDeptCb selectSysDeptCbById(Long id);
/**
* 查询单位从列表
*
* @param sysDeptCb 单位从
* @return 单位从集合
*/
public List<SysDeptCb> selectSysDeptCbList(SysDeptCb sysDeptCb);
/**
* 新增单位从
*
* @param sysDeptCb 单位从
* @return 结果
*/
public int insertSysDeptCb(SysDeptCb sysDeptCb);
/**
* 修改单位从
*
* @param sysDeptCb 单位从
* @return 结果
*/
public int updateSysDeptCb(SysDeptCb sysDeptCb);
/**
* 删除单位从
*
* @param id 单位从主键
* @return 结果
*/
public int deleteSysDeptCbById(Long id);
/**
* 批量删除单位从
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSysDeptCbByIds(Long[] ids);
SysDeptCb getInfoBydeptId(SysDeptCb sysDeptCb);
int deleteSysDeptCbByDeptId(@Param("deptId") String deptId, @Param("nd")String nd);
}
package com.qianhe.system.service;
import java.util.List;
import com.qianhe.system.domain.SysDeptCb;
/**
* 单位从Service接口
*
* @author qianhe
* @date 2024-07-10
*/
public interface ISysDeptCbService
{
/**
* 查询单位从
*
* @param id 单位从主键
* @return 单位从
*/
public SysDeptCb selectSysDeptCbById(Long id);
/**
* 查询单位从列表
*
* @param sysDeptCb 单位从
* @return 单位从集合
*/
public List<SysDeptCb> selectSysDeptCbList(SysDeptCb sysDeptCb);
/**
* 新增单位从
*
* @param sysDeptCb 单位从
* @return 结果
*/
public int insertSysDeptCb(SysDeptCb sysDeptCb);
/**
* 修改单位从
*
* @param sysDeptCb 单位从
* @return 结果
*/
public int updateSysDeptCb(SysDeptCb sysDeptCb);
/**
* 批量删除单位从
*
* @param ids 需要删除的单位从主键集合
* @return 结果
*/
public int deleteSysDeptCbByIds(Long[] ids);
/**
* 删除单位从信息
*
* @param id 单位从主键
* @return 结果
*/
public int deleteSysDeptCbById(Long id);
SysDeptCb getInfoBydeptId(SysDeptCb sysDeptCb);
}
package com.qianhe.system.service.impl;
import java.util.List;
import com.qianhe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.qianhe.system.mapper.SysDeptCbMapper;
import com.qianhe.system.domain.SysDeptCb;
import com.qianhe.system.service.ISysDeptCbService;
/**
* 单位从Service业务层处理
*
* @author qianhe
* @date 2024-07-10
*/
@Service
public class SysDeptCbServiceImpl implements ISysDeptCbService
{
@Autowired
private SysDeptCbMapper sysDeptCbMapper;
/**
* 查询单位从
*
* @param id 单位从主键
* @return 单位从
*/
@Override
public SysDeptCb selectSysDeptCbById(Long id)
{
return sysDeptCbMapper.selectSysDeptCbById(id);
}
/**
* 查询单位从列表
*
* @param sysDeptCb 单位从
* @return 单位从
*/
@Override
public List<SysDeptCb> selectSysDeptCbList(SysDeptCb sysDeptCb)
{
return sysDeptCbMapper.selectSysDeptCbList(sysDeptCb);
}
/**
* 新增单位从
*
* @param sysDeptCb 单位从
* @return 结果
*/
@Override
public int insertSysDeptCb(SysDeptCb sysDeptCb)
{
//根据部门id 删除
String nd = DateUtils.parseDateToStr("yyyy", DateUtils.getNowDate());
sysDeptCbMapper.deleteSysDeptCbByDeptId(sysDeptCb.getDeptId(),nd);
sysDeptCb.setNd(nd);
return sysDeptCbMapper.insertSysDeptCb(sysDeptCb);
}
/**
* 修改单位从
*
* @param sysDeptCb 单位从
* @return 结果
*/
@Override
public int updateSysDeptCb(SysDeptCb sysDeptCb)
{
return sysDeptCbMapper.updateSysDeptCb(sysDeptCb);
}
/**
* 批量删除单位从
*
* @param ids 需要删除的单位从主键
* @return 结果
*/
@Override
public int deleteSysDeptCbByIds(Long[] ids)
{
return sysDeptCbMapper.deleteSysDeptCbByIds(ids);
}
/**
* 删除单位从信息
*
* @param id 单位从主键
* @return 结果
*/
@Override
public int deleteSysDeptCbById(Long id)
{
return sysDeptCbMapper.deleteSysDeptCbById(id);
}
@Override
public SysDeptCb getInfoBydeptId(SysDeptCb sysDeptCb) {
return sysDeptCbMapper.getInfoBydeptId(sysDeptCb);
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qianhe.system.mapper.SysDeptCbMapper">
<resultMap type="SysDeptCb" id="SysDeptCbResult">
<result property="id" column="id" />
<result property="deptId" column="dept_id" />
<result property="nd" column="nd" />
<result property="dwlx" column="dwlx" />
<result property="jyqlhjysr" column="jyqlhjysr" />
<result property="jcrysl" column="jcrysl" />
<result property="jcdwsl" column="jcdwsl" />
<result property="yxbzsl" column="yxbzsl" />
</resultMap>
<sql id="selectSysDeptCbVo">
select id, dept_id, nd, dwlx, jyqlhjysr, jcrysl, jcdwsl, yxbzsl from sys_dept_cb
</sql>
<select id="selectSysDeptCbList" parameterType="SysDeptCb" resultMap="SysDeptCbResult">
<include refid="selectSysDeptCbVo"/>
<where>
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId}</if>
<if test="nd != null and nd != ''"> and nd = #{nd}</if>
<if test="dwlx != null and dwlx != ''"> and dwlx = #{dwlx}</if>
<if test="jyqlhjysr != null "> and jyqlhjysr = #{jyqlhjysr}</if>
<if test="jcrysl != null "> and jcrysl = #{jcrysl}</if>
<if test="jcdwsl != null "> and jcdwsl = #{jcdwsl}</if>
<if test="yxbzsl != null "> and yxbzsl = #{yxbzsl}</if>
</where>
</select>
<select id="selectSysDeptCbById" parameterType="Long" resultMap="SysDeptCbResult">
<include refid="selectSysDeptCbVo"/>
where id = #{id}
</select>
<select id="getInfoBydeptId" resultMap="SysDeptCbResult">
<include refid="selectSysDeptCbVo"/>
where dept_id = #{deptId} and nd = #{nd}
</select>
<insert id="insertSysDeptCb" parameterType="SysDeptCb" useGeneratedKeys="true" keyProperty="id">
insert into sys_dept_cb
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deptId != null">dept_id,</if>
<if test="nd != null">nd,</if>
<if test="dwlx != null">dwlx,</if>
<if test="jyqlhjysr != null">jyqlhjysr,</if>
<if test="jcrysl != null">jcrysl,</if>
<if test="jcdwsl != null">jcdwsl,</if>
<if test="yxbzsl != null">yxbzsl,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deptId != null">#{deptId},</if>
<if test="nd != null">#{nd},</if>
<if test="dwlx != null">#{dwlx},</if>
<if test="jyqlhjysr != null">#{jyqlhjysr},</if>
<if test="jcrysl != null">#{jcrysl},</if>
<if test="jcdwsl != null">#{jcdwsl},</if>
<if test="yxbzsl != null">#{yxbzsl},</if>
</trim>
</insert>
<update id="updateSysDeptCb" parameterType="SysDeptCb">
update sys_dept_cb
<trim prefix="SET" suffixOverrides=",">
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="nd != null">nd = #{nd},</if>
<if test="dwlx != null">dwlx = #{dwlx},</if>
<if test="jyqlhjysr != null">jyqlhjysr = #{jyqlhjysr},</if>
<if test="jcrysl != null">jcrysl = #{jcrysl},</if>
<if test="jcdwsl != null">jcdwsl = #{jcdwsl},</if>
<if test="yxbzsl != null">yxbzsl = #{yxbzsl},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSysDeptCbById" parameterType="Long">
delete from sys_dept_cb where id = #{id}
</delete>
<delete id="deleteSysDeptCbByIds" parameterType="String">
delete from sys_dept_cb where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteSysDeptCbByDeptId">
delete from sys_dept_cb where dept_id = #{deptId} and nd = #{nd}
</delete>
</mapper>
\ No newline at end of file
...@@ -151,10 +151,21 @@ public class SjFybpController extends BaseController ...@@ -151,10 +151,21 @@ public class SjFybpController extends BaseController
public TableDataInfo zglist(SjFybp sjFybp) public TableDataInfo zglist(SjFybp sjFybp)
{ {
startPage(); startPage();
List<SjFybp> list = sjFybpService.selectSjFybpList(sjFybp); List<SjFybp> list = sjFybpService.getFygz(sjFybp);
return getDataTable(list); return getDataTable(list);
} }
/**
* 查询三基-费用报批列表
*/
@GetMapping("/getFygzById/{id}")
public AjaxResult getFygz(@PathVariable Long id)
{
return AjaxResult.success(sjFybpService.getFygzById(id));
}
/** /**
* 费用维护 * 费用维护
*/ */
......
package com.qianhe.controller;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.qianhe.common.utils.DateUtils;
import com.qianhe.common.utils.SecurityUtils;
import com.qianhe.common.utils.StringUtils;
import com.qianhe.domain.SjFybp;
import com.qianhe.system.domain.SysDeptCb;
import com.qianhe.system.mapper.SysDeptCbMapper;
import com.qianhe.system.mapper.SysDeptMapper;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.qianhe.common.annotation.Log;
import com.qianhe.common.core.controller.BaseController;
import com.qianhe.common.core.domain.AjaxResult;
import com.qianhe.common.enums.BusinessType;
import com.qianhe.domain.SjFybpZb;
import com.qianhe.service.ISjFybpZbService;
import com.qianhe.common.utils.poi.ExcelUtil;
import com.qianhe.common.core.page.TableDataInfo;
/**
* 三基-费用报批主Controller
*
* @author qianhe
* @date 2024-07-11
*/
@RestController
@RequestMapping("/system/sjFybpZb")
public class SjFybpZbController extends BaseController
{
@Autowired
private ISjFybpZbService sjFybpZbService;
@Autowired
private SysDeptCbMapper sysDeptCbMapper;
/**
* 查询三基-费用报批主列表
*/
@PreAuthorize("@ss.hasPermi('system:sjFybpZb:list')")
@GetMapping("/list")
public TableDataInfo list(SjFybpZb sjFybpZb)
{
startPage();
List<SjFybpZb> list = sjFybpZbService.selectSjFybpZbList(sjFybpZb);
return getDataTable(list);
}
/**
* 导出三基-费用报批主列表
*/
@PreAuthorize("@ss.hasPermi('system:sjFybpZb:export')")
@Log(title = "三基-费用报批主", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SjFybpZb sjFybpZb)
{
List<SjFybpZb> list = sjFybpZbService.selectSjFybpZbList(sjFybpZb);
ExcelUtil<SjFybpZb> util = new ExcelUtil<SjFybpZb>(SjFybpZb.class);
util.exportExcel(response, list, "三基-费用报批主数据");
}
/**
* 获取三基-费用报批主详细信息
*/
@PreAuthorize("@ss.hasPermi('system:sjFybpZb:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sjFybpZbService.selectSjFybpZbById(id));
}
/**
* 新增三基-费用报批主
*/
@PreAuthorize("@ss.hasPermi('system:sjFybpZb:add')")
@Log(title = "三基-费用报批主", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SjFybpZb sjFybpZb)
{
int i = sjFybpZbService.insertSjFybpZb(sjFybpZb);
SysDeptCb sysDeptCb =new SysDeptCb();
sysDeptCb.setNd(sjFybpZb.getFyrq());
sysDeptCb.setDeptId(sjFybpZb.getDeptId());
SysDeptCb deptCb = sysDeptCbMapper.getInfoBydeptId(sysDeptCb);
String msg="";
if(deptCb==null){
msg="保存成功!您单位基础信息未维护,请到部门管理中进行设置!";
}else {
if(StringUtils.isNotEmpty( deptCb.getDwlx() )){
String dwlx = deptCb.getDwlx();
BigDecimal jyqlhjysr = deptCb.getJyqlhjysr();//万吨 换算成吨
BigDecimal jcrysl = BigDecimal.valueOf(deptCb.getJcrysl());
BigDecimal jcdwsl = BigDecimal.valueOf(deptCb.getJcdwsl());
BigDecimal yxbzsl = BigDecimal.valueOf(deptCb.getYxbzsl());
BigDecimal fyje = sjFybpZb.getFyje()!=null?sjFybpZb.getFyje():new BigDecimal(0);
fyje=fyje.setScale(2,BigDecimal.ROUND_HALF_UP);
if("油气开发单位".equals(dwlx)){
//计算标准
jyqlhjysr= deptCb.getJyqlhjysr().multiply(new BigDecimal(10000));//万吨 换算成吨
BigDecimal jys= jyqlhjysr.multiply(new BigDecimal(2)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal rys=jcrysl.multiply(new BigDecimal(1000)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal dws=jcdwsl.multiply(new BigDecimal(150000)).multiply(new BigDecimal(0.2)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal bzs=yxbzsl.multiply(new BigDecimal(20000)).multiply(new BigDecimal(0.2)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal sum=jys.add(rys).add(dws).add(bzs);
sum=sum.divide(new BigDecimal(10000)).setScale(2,BigDecimal.ROUND_HALF_UP);
if(fyje.compareTo(sum)>-1){
msg="保存成功!费用总额"+fyje+"万元不低于"+sum+"万元。\n计算标准为:"
+deptCb.getJyqlhjysr()+"万吨*2元/吨*30%+"+jcrysl+"*1000元/人*30%+"+jcdwsl+"*15万元/单位*20%+"+yxbzsl+"*2万元/班站*20%="+sum;
}else {
msg="保存成功!费用总额"+fyje+"万元低于"+sum+"万元。\n计算标准为:"
+deptCb.getJyqlhjysr()+"万吨*2元/吨*30%+"+jcrysl+"*1000元/人*30%+"+jcdwsl+"*15万元/单位*20%+"+yxbzsl+"*2万元/班站*20%="+sum;
}
}else if("主要专业化单位".equals(dwlx)) {
//计算标准
if(yxbzsl.equals(new BigDecimal(0))){
BigDecimal jys= jyqlhjysr.multiply(new BigDecimal(0.0001)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal rys=jcrysl.multiply(new BigDecimal(1000)).multiply(new BigDecimal(0.4)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal dws=jcdwsl.multiply(new BigDecimal(150000)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal sum=jys.add(rys).add(dws);
sum=sum.divide(new BigDecimal(10000)).setScale(2,BigDecimal.ROUND_HALF_UP);
if(fyje.compareTo(sum)>-1){
msg="保存成功!费用总额"+fyje+"万元不低于"+sum+"万元。\n计算标准为:"
+deptCb.getJyqlhjysr()+"万元*1‰*30%+"+jcrysl+"*1000元/人*40%+"+jcdwsl+"*15万元/单位*30%="+sum;
}else {
msg="保存成功!费用总额"+fyje+"万元低于"+sum+"万元。\n计算标准为:"
+deptCb.getJyqlhjysr()+"万吨*2元/吨*30%+"+jcrysl+"*1000元/人*40%+"+jcdwsl+"*15万元/单位*30%="+sum;
}
}else {
BigDecimal jys= jyqlhjysr.multiply(new BigDecimal(0.0001)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal rys=jcrysl.multiply(new BigDecimal(1000)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal dws=jcdwsl.multiply(new BigDecimal(150000)).multiply(new BigDecimal(0.2)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal bzs=yxbzsl.multiply(new BigDecimal(20000)).multiply(new BigDecimal(0.2)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal sum=jys.add(rys).add(dws).add(bzs);
sum=sum.divide(new BigDecimal(10000)).setScale(2,BigDecimal.ROUND_HALF_UP);
if(fyje.compareTo(sum)>-1){
msg="保存成功!费用总额"+fyje+"万元不低于"+sum+"万元。\n计算标准为:"
+deptCb.getJyqlhjysr()+"万元*1‰*30%+"+jcrysl+"*1000元/人*30%+"+jcdwsl+"*15万元/单位*20%+"+yxbzsl+"*2万元/班站*20%="+sum;
}else {
msg="保存成功!费用总额"+fyje+"万元低于"+sum+"万元。\n计算标准为:"
+deptCb.getJyqlhjysr()+"万吨*2元/吨*30%+"+jcrysl+"*1000元/人*30%+"+jcdwsl+"*15万元/单位*20%+"+yxbzsl+"*2万元/班站*20%="+sum;
}
}
}else if("科研、监督、服务协调单位".equals(dwlx)) {
BigDecimal jys= jyqlhjysr.multiply(new BigDecimal(0.0001)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal rys=jcrysl.multiply(new BigDecimal(1000)).multiply(new BigDecimal(0.4)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal dws=jcdwsl.multiply(new BigDecimal(50000)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal sum=jys.add(rys).add(dws);
sum=sum.divide(new BigDecimal(10000)).setScale(2,BigDecimal.ROUND_HALF_UP);
if(fyje.compareTo(sum)>-1){
msg="保存成功!费用总额"+fyje+"万元不低于"+sum+"万元。\n计算标准为:"
+deptCb.getJyqlhjysr()+"万元*1‰*30%+"+jcrysl+"*1000元/人*40%+"+jcdwsl+"*5万元/单位*30%="+sum;
}else {
msg="保存成功!费用总额"+fyje+"万元低于"+sum+"万元。\n计算标准为:"
+deptCb.getJyqlhjysr()+"万吨*2元/吨*30%+"+jcrysl+"*1000元/人*40%+"+jcdwsl+"*5万元/单位*30%="+sum;
}
}
}
}
return AjaxResult.success(msg);
}
/**
* 修改三基-费用报批主
*/
@PreAuthorize("@ss.hasPermi('system:sjFybpZb:edit')")
@Log(title = "三基-费用报批主", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SjFybpZb sjFybpZb)
{
int i = sjFybpZbService.updateSjFybpZb(sjFybpZb);
SysDeptCb sysDeptCb =new SysDeptCb();
sysDeptCb.setNd(sjFybpZb.getFyrq());
sysDeptCb.setDeptId(sjFybpZb.getDeptId());
SysDeptCb deptCb = sysDeptCbMapper.getInfoBydeptId(sysDeptCb);
String msg="";
if(deptCb==null){
msg="保存成功!您单位基础信息未维护,请到部门管理中进行设置!";
}else {
if(StringUtils.isNotEmpty( deptCb.getDwlx() )){
String dwlx = deptCb.getDwlx();
BigDecimal jyqlhjysr = deptCb.getJyqlhjysr();//万吨 换算成吨
BigDecimal jcrysl = BigDecimal.valueOf(deptCb.getJcrysl());
BigDecimal jcdwsl = BigDecimal.valueOf(deptCb.getJcdwsl());
BigDecimal yxbzsl = BigDecimal.valueOf(deptCb.getYxbzsl());
BigDecimal fyje = sjFybpZb.getFyje()!=null?sjFybpZb.getFyje():new BigDecimal(0);
fyje=fyje.setScale(2,BigDecimal.ROUND_HALF_UP);
if("油气开发单位".equals(dwlx)){
//计算标准
jyqlhjysr= deptCb.getJyqlhjysr().multiply(new BigDecimal(10000));//万吨 换算成吨
BigDecimal jys= jyqlhjysr.multiply(new BigDecimal(2)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal rys=jcrysl.multiply(new BigDecimal(1000)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal dws=jcdwsl.multiply(new BigDecimal(150000)).multiply(new BigDecimal(0.2)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal bzs=yxbzsl.multiply(new BigDecimal(20000)).multiply(new BigDecimal(0.2)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal sum=jys.add(rys).add(dws).add(bzs);
sum=sum.divide(new BigDecimal(10000)).setScale(2,BigDecimal.ROUND_HALF_UP);
if(fyje.compareTo(sum)>-1){
msg="保存成功!费用总额"+fyje+"万元不低于"+sum+"万元。\n计算标准为:"
+deptCb.getJyqlhjysr()+"万吨*2元/吨*30%+"+jcrysl+"*1000元/人*30%+"+jcdwsl+"*15万元/单位*20%+"+yxbzsl+"*2万元/班站*20%="+sum;
}else {
msg="保存成功!费用总额"+fyje+"万元低于"+sum+"万元。\n计算标准为:"
+deptCb.getJyqlhjysr()+"万吨*2元/吨*30%+"+jcrysl+"*1000元/人*30%+"+jcdwsl+"*15万元/单位*20%+"+yxbzsl+"*2万元/班站*20%="+sum;
}
}else if("主要专业化单位".equals(dwlx)) {
//计算标准
if(yxbzsl.equals(new BigDecimal(0))){
BigDecimal jys= jyqlhjysr.multiply(new BigDecimal(0.0001)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal rys=jcrysl.multiply(new BigDecimal(1000)).multiply(new BigDecimal(0.4)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal dws=jcdwsl.multiply(new BigDecimal(150000)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal sum=jys.add(rys).add(dws);
sum=sum.divide(new BigDecimal(10000)).setScale(2,BigDecimal.ROUND_HALF_UP);
if(fyje.compareTo(sum)>-1){
msg="保存成功!费用总额"+fyje+"万元不低于"+sum+"万元。\n计算标准为:"
+deptCb.getJyqlhjysr()+"万元*1‰*30%+"+jcrysl+"*1000元/人*40%+"+jcdwsl+"*15万元/单位*30%="+sum;
}else {
msg="保存成功!费用总额"+fyje+"万元低于"+sum+"万元。\n计算标准为:"
+deptCb.getJyqlhjysr()+"万吨*2元/吨*30%+"+jcrysl+"*1000元/人*40%+"+jcdwsl+"*15万元/单位*30%="+sum;
}
}else {
BigDecimal jys= jyqlhjysr.multiply(new BigDecimal(0.0001)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal rys=jcrysl.multiply(new BigDecimal(1000)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal dws=jcdwsl.multiply(new BigDecimal(150000)).multiply(new BigDecimal(0.2)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal bzs=yxbzsl.multiply(new BigDecimal(20000)).multiply(new BigDecimal(0.2)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal sum=jys.add(rys).add(dws).add(bzs);
sum=sum.divide(new BigDecimal(10000)).setScale(2,BigDecimal.ROUND_HALF_UP);
if(fyje.compareTo(sum)>-1){
msg="保存成功!费用总额"+fyje+"万元不低于"+sum+"万元。\n计算标准为:"
+deptCb.getJyqlhjysr()+"万元*1‰*30%+"+jcrysl+"*1000元/人*30%+"+jcdwsl+"*15万元/单位*20%+"+yxbzsl+"*2万元/班站*20%="+sum;
}else {
msg="保存成功!费用总额"+fyje+"万元低于"+sum+"万元。\n计算标准为:"
+deptCb.getJyqlhjysr()+"万吨*2元/吨*30%+"+jcrysl+"*1000元/人*30%+"+jcdwsl+"*15万元/单位*20%+"+yxbzsl+"*2万元/班站*20%="+sum;
}
}
}else if("科研、监督、服务协调单位".equals(dwlx)) {
BigDecimal jys= jyqlhjysr.multiply(new BigDecimal(0.0001)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal rys=jcrysl.multiply(new BigDecimal(1000)).multiply(new BigDecimal(0.4)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal dws=jcdwsl.multiply(new BigDecimal(50000)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal sum=jys.add(rys).add(dws);
sum=sum.divide(new BigDecimal(10000)).setScale(2,BigDecimal.ROUND_HALF_UP);
if(fyje.compareTo(sum)>-1){
msg="保存成功!费用总额"+fyje+"万元不低于"+sum+"万元。\n计算标准为:"
+deptCb.getJyqlhjysr()+"万元*1‰*30%+"+jcrysl+"*1000元/人*40%+"+jcdwsl+"*5万元/单位*30%="+sum;
}else {
msg="保存成功!费用总额"+fyje+"万元低于"+sum+"万元。\n计算标准为:"
+deptCb.getJyqlhjysr()+"万吨*2元/吨*30%+"+jcrysl+"*1000元/人*40%+"+jcdwsl+"*5万元/单位*30%="+sum;
}
}
}
}
return AjaxResult.success(msg);
}
/**
* 删除三基-费用报批主
*/
@PreAuthorize("@ss.hasPermi('system:sjFybpZb:remove')")
@Log(title = "三基-费用报批主", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sjFybpZbService.deleteSjFybpZbByIds(ids));
}
/**
* 提交
*/
@Log(title = "三基-费用报批", businessType = BusinessType.UPDATE)
@PostMapping("/tj")
public AjaxResult tj(@RequestBody SjFybpZb sjFybpZb)
{
sjFybpZb.setTjr(SecurityUtils.getUsername());
sjFybpZb.setTjrq(DateUtils.dateTimeNow("yyyy-MM-dd HH:mm:ss"));
return toAjax(sjFybpZbService.tj(sjFybpZb));
}
/**
* 提交
*/
@Log(title = "三基-费用报批", businessType = BusinessType.UPDATE)
@PostMapping("/sp")
public AjaxResult sp(@RequestBody SjFybpZb sjFybpZb)
{
sjFybpZb.setSpr(SecurityUtils.getUsername());
sjFybpZb.setSprq(DateUtils.dateTimeNow("yyyy-MM-dd HH:mm:ss"));
return toAjax(sjFybpZbService.tj(sjFybpZb));
}
@GetMapping("/splist")
public TableDataInfo splist(SjFybpZb sjFybpZb)
{
startPage();
sjFybpZb.setSpcx("1");
List<SjFybpZb> list = sjFybpZbService.selectSjFybpZbList(sjFybpZb);
return getDataTable(list);
}
/**
* 获取三基-费用报批主详细信息
*/
// @PreAuthorize("@ss.hasPermi('system:sjFybpZb:query')")
@GetMapping(value = "/getInfoBySp/{id}")
public AjaxResult getInfoBySp(@PathVariable("id") Long id)
{
SjFybpZb sjFybpZb = sjFybpZbService.selectSjFybpZbById(id);
SysDeptCb sysDeptCb =new SysDeptCb();
sysDeptCb.setNd(sjFybpZb.getFyrq());
sysDeptCb.setDeptId(sjFybpZb.getDeptId());
SysDeptCb deptCb = sysDeptCbMapper.getInfoBydeptId(sysDeptCb);
if(deptCb==null){
sjFybpZb.setJl("您单位基础信息未维护,请到部门管理中进行设置!");
}else {
if(StringUtils.isNotEmpty( deptCb.getDwlx() )){
String dwlx = deptCb.getDwlx();
BigDecimal jyqlhjysr = deptCb.getJyqlhjysr();//万吨 换算成吨
BigDecimal jcrysl = BigDecimal.valueOf(deptCb.getJcrysl());
BigDecimal jcdwsl = BigDecimal.valueOf(deptCb.getJcdwsl());
BigDecimal yxbzsl = BigDecimal.valueOf(deptCb.getYxbzsl());
BigDecimal fyje = sjFybpZb.getFyje()!=null?sjFybpZb.getFyje():new BigDecimal(0);
fyje=fyje.setScale(2,BigDecimal.ROUND_HALF_UP);
if("油气开发单位".equals(dwlx)){
//计算标准
jyqlhjysr= deptCb.getJyqlhjysr().multiply(new BigDecimal(10000));//万吨 换算成吨
BigDecimal jys= jyqlhjysr.multiply(new BigDecimal(2)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal rys=jcrysl.multiply(new BigDecimal(1000)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal dws=jcdwsl.multiply(new BigDecimal(150000)).multiply(new BigDecimal(0.2)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal bzs=yxbzsl.multiply(new BigDecimal(20000)).multiply(new BigDecimal(0.2)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal sum=jys.add(rys).add(dws).add(bzs);
sum=sum.divide(new BigDecimal(10000)).setScale(2,BigDecimal.ROUND_HALF_UP);
if(fyje.compareTo(sum)>-1){
sjFybpZb.setJl("费用总额"+fyje+"万元不低于"+sum+"万元。");
sjFybpZb.setJlflag(true);
}else {
sjFybpZb.setJl("费用总额"+fyje+"万元低于"+sum+"万元。");
sjFybpZb.setJlflag(false);
}
sjFybpZb.setJsbz("计算标准为:"
+deptCb.getJyqlhjysr()+"万吨*2元/吨*30%+"+jcrysl+"*1000元/人*30%+"+jcdwsl+"*15万元/单位*20%+"+yxbzsl+"*2万元/班站*20%="+sum);
sjFybpZb.setTqbz("交油气量(万吨)×2 元/吨×30%+基层人员数量×1000 元/人×30%+\n" +
"基层单位数量×15 万元/单位×20%+一线班站数量×2 万元/班站×20%");
}else if("主要专业化单位".equals(dwlx)) {
//计算标准
if(yxbzsl.equals(new BigDecimal(0))){
BigDecimal jys= jyqlhjysr.multiply(new BigDecimal(0.0001)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal rys=jcrysl.multiply(new BigDecimal(1000)).multiply(new BigDecimal(0.4)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal dws=jcdwsl.multiply(new BigDecimal(150000)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal sum=jys.add(rys).add(dws);
sum=sum.divide(new BigDecimal(10000)).setScale(2,BigDecimal.ROUND_HALF_UP);
if(fyje.compareTo(sum)>-1){
sjFybpZb.setJl("费用总额"+fyje+"万元不低于"+sum+"万元。");
sjFybpZb.setJlflag(true);
}else {
sjFybpZb.setJl("费用总额"+fyje+"万元低于"+sum+"万元。");
sjFybpZb.setJlflag(false);
}
sjFybpZb.setJsbz("计算标准为:"
+deptCb.getJyqlhjysr()+"万吨*2元/吨*30%+"+jcrysl+"*1000元/人*40%+"+jcdwsl+"*15万元/单位*30%="+sum);
sjFybpZb.setTqbz("经营收入(万元)×1‰×30%+基层人员数量×1000 元/人×40%+基层\n" +
"单位数量×15 万元/单位×30%");
}else {
BigDecimal jys= jyqlhjysr.multiply(new BigDecimal(0.0001)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal rys=jcrysl.multiply(new BigDecimal(1000)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal dws=jcdwsl.multiply(new BigDecimal(150000)).multiply(new BigDecimal(0.2)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal bzs=yxbzsl.multiply(new BigDecimal(20000)).multiply(new BigDecimal(0.2)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal sum=jys.add(rys).add(dws).add(bzs);
sum=sum.divide(new BigDecimal(10000)).setScale(2,BigDecimal.ROUND_HALF_UP);
if(fyje.compareTo(sum)>-1){
sjFybpZb.setJl("费用总额"+fyje+"万元不低于"+sum+"万元。");
sjFybpZb.setJlflag(true);
}else {
sjFybpZb.setJl("费用总额"+fyje+"万元低于"+sum+"万元。");
sjFybpZb.setJlflag(false);
}
sjFybpZb.setJsbz("计算标准为:"
+deptCb.getJyqlhjysr()+"万吨*2元/吨*30%+"+jcrysl+"*1000元/人*30%+"+jcdwsl+"*15万元/单位*20%+"+yxbzsl+"*2万元/班站*20%="+sum);
sjFybpZb.setTqbz("经营收入(万元)×1‰×30%+基层人员数量×1000 元/人×30%+基层\n" +
"单位数量×15 万元/单位×20%+一线班站数量×2 万元/班站×20%");
}
}else if("科研、监督、服务协调单位".equals(dwlx)) {
BigDecimal jys= jyqlhjysr.multiply(new BigDecimal(0.0001)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal rys=jcrysl.multiply(new BigDecimal(1000)).multiply(new BigDecimal(0.4)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal dws=jcdwsl.multiply(new BigDecimal(50000)).multiply(new BigDecimal(0.3)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal sum=jys.add(rys).add(dws);
sum=sum.divide(new BigDecimal(10000)).setScale(2,BigDecimal.ROUND_HALF_UP);
if(fyje.compareTo(sum)>-1){
sjFybpZb.setJl("费用总额"+fyje+"万元不低于"+sum+"万元。");
sjFybpZb.setJlflag(true);
}else {
sjFybpZb.setJl("费用总额"+fyje+"万元低于"+sum+"万元。");
sjFybpZb.setJlflag(false);
}
sjFybpZb.setJsbz("计算标准为:"
+deptCb.getJyqlhjysr()+"万吨*2元/吨*30%+"+jcrysl+"*1000元/人*40%+"+jcdwsl+"*5万元/单位*30%="+sum);
sjFybpZb.setTqbz("经营收入(万元)×1‰×30%+基层人员数量×1000 元/人×40%+基层\n" +
"单位数量×5 万元/单位×30%");
}
}
}
return success(sjFybpZb);
}
}
...@@ -217,5 +217,76 @@ public class SjLhscController extends BaseController ...@@ -217,5 +217,76 @@ public class SjLhscController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/**
* 统计解决问题数量(二级)
* @return
*/
@GetMapping("/tjByEjJjwtSl")
public TableDataInfo tjByEjJjwtSl(SjLhscVo vo)
{
vo.setDwjb("3");
String nd="";
if(StringUtils.isNotEmpty(vo.getNd())){
nd=vo.getNd();
}
String startJd="";
String endJd="";
if(StringUtils.isNotEmpty(vo.getJb())){
String jd=vo.getJb();
if("1".equals(jd)){
startJd=nd+"-01";
endJd=nd+"-03";
}else if("2".equals(jd)){
startJd=nd+"-04";
endJd=nd+"-06";
}if("3".equals(jd)){
startJd=nd+"-07";
endJd=nd+"-09";
}if("4".equals(jd)){
startJd=nd+"-10";
endJd=nd+"-12";
}
}
vo.setStartJd(startJd);
vo.setEndJd(endJd);
List<SjLhscVo> list = sjLhscService.tjByEjJjwtSl(vo);
return getDataTable(list);
}
/**
* 统计解决问题数量(三级)
* @return
*/
@GetMapping("/tjBySjJjwtSl")
public TableDataInfo tjBySjJjwtSl(SjLhscVo vo)
{
vo.setDwjb("4");
String nd="";
if(StringUtils.isNotEmpty(vo.getNd())){
nd=vo.getNd();
}
String startJd="";
String endJd="";
if(StringUtils.isNotEmpty(vo.getJb())){
String jd=vo.getJb();
if("1".equals(jd)){
startJd=nd+"-01";
endJd=nd+"-03";
}else if("2".equals(jd)){
startJd=nd+"-04";
endJd=nd+"-06";
}if("3".equals(jd)){
startJd=nd+"-07";
endJd=nd+"-09";
}if("4".equals(jd)){
startJd=nd+"-10";
endJd=nd+"-12";
}
}
vo.setStartJd(startJd);
vo.setEndJd(endJd);
List<SjLhscVo> list = sjLhscService.tjByEjJjwtSl(vo);
return getDataTable(list);
}
} }
...@@ -23,6 +23,7 @@ public class SjFybp extends BaseEntity ...@@ -23,6 +23,7 @@ public class SjFybp extends BaseEntity
/** 主键 */ /** 主键 */
private Long id; private Long id;
private Long zbId;
/** 费用名称 */ /** 费用名称 */
@Excel(name = "费用名称") @Excel(name = "费用名称")
...@@ -116,6 +117,9 @@ public class SjFybp extends BaseEntity ...@@ -116,6 +117,9 @@ public class SjFybp extends BaseEntity
//数量 //数量
private Integer sl; private Integer sl;
private BigDecimal fyzje;
//批复金额总和 //批复金额总和
private BigDecimal pfjezh; private BigDecimal pfjezh;
//已使用金额总和 //已使用金额总和
......
package com.qianhe.domain;
import java.math.BigDecimal;
import java.util.List;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.qianhe.common.annotation.Excel;
import com.qianhe.common.core.domain.BaseEntity;
/**
* 三基-费用报批主对象 sj_fybp_zb
*
* @author qianhe
* @date 2024-07-11
*/
@Data
public class SjFybpZb extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 费用日期 */
@Excel(name = "费用日期")
private String fyrq;
/** 单位 */
@Excel(name = "单位")
private String deptId;
/** 费用金额 */
@Excel(name = "费用金额")
private BigDecimal fyje;
/** 状态(未提交、待审批、已审批、已驳回) */
@Excel(name = "状态(未提交、待审批、已审批、已驳回)")
private String zt;
/** 提交人 */
@Excel(name = "提交人")
private String tjr;
/** 提交日期 */
@Excel(name = "提交日期")
private String tjrq;
/** 审批日期 */
@Excel(name = "审批日期")
private String sprq;
/** 审批人 */
@Excel(name = "审批人")
private String spr;
/** 已使用金额 */
@Excel(name = "已使用金额")
private BigDecimal ysyje;
/** 审批意见 */
@Excel(name = "审批意见")
private String spyj;
/** 预留1 */
@Excel(name = "预留1")
private String yl1;
/** 预留2 */
@Excel(name = "预留2")
private String yl2;
/** 预留3 */
@Excel(name = "预留3")
private String yl3;
/** 预留4 */
@Excel(name = "预留4")
private String yl4;
/** 预留5 */
@Excel(name = "预留5")
private String yl5;
/** 三基-费用报批信息 */
private List<SjFybp> sjFybpList;
private List<WdWdxx> fileList;
private String deptName;
private String sprName;
private String spcx;
private String tqbz;
private String jsbz;
private String jl;
private Boolean jlflag;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setFyrq(String fyrq)
{
this.fyrq = fyrq;
}
public String getFyrq()
{
return fyrq;
}
public void setDeptId(String deptId)
{
this.deptId = deptId;
}
public String getDeptId()
{
return deptId;
}
public void setFyje(BigDecimal fyje)
{
this.fyje = fyje;
}
public BigDecimal getFyje()
{
return fyje;
}
public void setZt(String zt)
{
this.zt = zt;
}
public String getZt()
{
return zt;
}
public void setTjr(String tjr)
{
this.tjr = tjr;
}
public String getTjr()
{
return tjr;
}
public void setTjrq(String tjrq)
{
this.tjrq = tjrq;
}
public String getTjrq()
{
return tjrq;
}
public void setSprq(String sprq)
{
this.sprq = sprq;
}
public String getSprq()
{
return sprq;
}
public void setSpr(String spr)
{
this.spr = spr;
}
public String getSpr()
{
return spr;
}
public void setYsyje(BigDecimal ysyje)
{
this.ysyje = ysyje;
}
public BigDecimal getYsyje()
{
return ysyje;
}
public void setSpyj(String spyj)
{
this.spyj = spyj;
}
public String getSpyj()
{
return spyj;
}
public void setYl1(String yl1)
{
this.yl1 = yl1;
}
public String getYl1()
{
return yl1;
}
public void setYl2(String yl2)
{
this.yl2 = yl2;
}
public String getYl2()
{
return yl2;
}
public void setYl3(String yl3)
{
this.yl3 = yl3;
}
public String getYl3()
{
return yl3;
}
public void setYl4(String yl4)
{
this.yl4 = yl4;
}
public String getYl4()
{
return yl4;
}
public void setYl5(String yl5)
{
this.yl5 = yl5;
}
public String getYl5()
{
return yl5;
}
public List<SjFybp> getSjFybpList()
{
return sjFybpList;
}
public void setSjFybpList(List<SjFybp> sjFybpList)
{
this.sjFybpList = sjFybpList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("fyrq", getFyrq())
.append("deptId", getDeptId())
.append("fyje", getFyje())
.append("zt", getZt())
.append("tjr", getTjr())
.append("tjrq", getTjrq())
.append("sprq", getSprq())
.append("spr", getSpr())
.append("ysyje", getYsyje())
.append("spyj", getSpyj())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("yl1", getYl1())
.append("yl2", getYl2())
.append("yl3", getYl3())
.append("yl4", getYl4())
.append("yl5", getYl5())
.append("sjFybpList", getSjFybpList())
.toString();
}
}
...@@ -38,6 +38,9 @@ public class SjLhscVo extends BaseEntity ...@@ -38,6 +38,9 @@ public class SjLhscVo extends BaseEntity
/** 状态(已提交、未提交) */ /** 状态(已提交、未提交) */
private String zt; private String zt;
//解决问题数量
private Integer jjwtsl;
......
...@@ -88,4 +88,13 @@ public interface SjFybpMapper ...@@ -88,4 +88,13 @@ public interface SjFybpMapper
List<SjFybp> tjtbByDept(SjFybp sjFybp); List<SjFybp> tjtbByDept(SjFybp sjFybp);
List<SjFybp> tjtbByfylx(SjFybp sjFybp); List<SjFybp> tjtbByfylx(SjFybp sjFybp);
List<SjFybp> selectSjFybpByZbId(Long zbid);
List<SjFybp> getFygz(SjFybp sjFybp);
SjFybp getFygzById(Long id);
} }
package com.qianhe.mapper;
import java.util.List;
import com.qianhe.domain.SjFybpZb;
import com.qianhe.domain.SjFybp;
/**
* 三基-费用报批主Mapper接口
*
* @author qianhe
* @date 2024-07-11
*/
public interface SjFybpZbMapper
{
/**
* 查询三基-费用报批主
*
* @param id 三基-费用报批主主键
* @return 三基-费用报批主
*/
public SjFybpZb selectSjFybpZbById(Long id);
/**
* 查询三基-费用报批主列表
*
* @param sjFybpZb 三基-费用报批主
* @return 三基-费用报批主集合
*/
public List<SjFybpZb> selectSjFybpZbList(SjFybpZb sjFybpZb);
/**
* 新增三基-费用报批主
*
* @param sjFybpZb 三基-费用报批主
* @return 结果
*/
public int insertSjFybpZb(SjFybpZb sjFybpZb);
/**
* 修改三基-费用报批主
*
* @param sjFybpZb 三基-费用报批主
* @return 结果
*/
public int updateSjFybpZb(SjFybpZb sjFybpZb);
/**
* 删除三基-费用报批主
*
* @param id 三基-费用报批主主键
* @return 结果
*/
public int deleteSjFybpZbById(Long id);
/**
* 批量删除三基-费用报批主
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSjFybpZbByIds(Long[] ids);
/**
* 批量删除三基-费用报批
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSjFybpByZbIds(Long[] ids);
/**
* 批量新增三基-费用报批
*
* @param sjFybpList 三基-费用报批列表
* @return 结果
*/
public int batchSjFybp(List<SjFybp> sjFybpList);
/**
* 通过三基-费用报批主主键删除三基-费用报批信息
*
* @param id 三基-费用报批主ID
* @return 结果
*/
public int deleteSjFybpByZbId(Long id);
}
...@@ -93,4 +93,6 @@ public interface SjLhscMapper ...@@ -93,4 +93,6 @@ public interface SjLhscMapper
List<SjLhscVo> tjBysfsc(SjLhscVo vo); List<SjLhscVo> tjBysfsc(SjLhscVo vo);
List<SjLhscVo> tjByEjJjwtSl(SjLhscVo vo);
} }
...@@ -69,4 +69,8 @@ public interface ISjFybpService ...@@ -69,4 +69,8 @@ public interface ISjFybpService
AjaxResult tjtbByfylx(SjFybp sjFybp); AjaxResult tjtbByfylx(SjFybp sjFybp);
List<SjFybp> getFygz(SjFybp sjFybp);
SjFybp getFygzById(Long id);
} }
package com.qianhe.service;
import java.util.List;
import com.qianhe.domain.SjFybpZb;
/**
* 三基-费用报批主Service接口
*
* @author qianhe
* @date 2024-07-11
*/
public interface ISjFybpZbService
{
/**
* 查询三基-费用报批主
*
* @param id 三基-费用报批主主键
* @return 三基-费用报批主
*/
public SjFybpZb selectSjFybpZbById(Long id);
/**
* 查询三基-费用报批主列表
*
* @param sjFybpZb 三基-费用报批主
* @return 三基-费用报批主集合
*/
public List<SjFybpZb> selectSjFybpZbList(SjFybpZb sjFybpZb);
/**
* 新增三基-费用报批主
*
* @param sjFybpZb 三基-费用报批主
* @return 结果
*/
public int insertSjFybpZb(SjFybpZb sjFybpZb);
/**
* 修改三基-费用报批主
*
* @param sjFybpZb 三基-费用报批主
* @return 结果
*/
public int updateSjFybpZb(SjFybpZb sjFybpZb);
/**
* 批量删除三基-费用报批主
*
* @param ids 需要删除的三基-费用报批主主键集合
* @return 结果
*/
public int deleteSjFybpZbByIds(Long[] ids);
/**
* 删除三基-费用报批主信息
*
* @param id 三基-费用报批主主键
* @return 结果
*/
public int deleteSjFybpZbById(Long id);
int tj(SjFybpZb sjFybpZb);
}
...@@ -64,4 +64,5 @@ public interface ISjLhscService ...@@ -64,4 +64,5 @@ public interface ISjLhscService
List<SjLhscVo> tjBysfsc(SjLhscVo vo); List<SjLhscVo> tjBysfsc(SjLhscVo vo);
List<SjLhscVo> tjByEjJjwtSl(SjLhscVo vo);
} }
...@@ -53,6 +53,7 @@ public class SjFybpServiceImpl implements ISjFybpService ...@@ -53,6 +53,7 @@ public class SjFybpServiceImpl implements ISjFybpService
SjFybp sjFybp = sjFybpMapper.selectSjFybpById(id); SjFybp sjFybp = sjFybpMapper.selectSjFybpById(id);
//查询费用维护 //查询费用维护
SjFybpWh sjFybpWh=new SjFybpWh(); SjFybpWh sjFybpWh=new SjFybpWh();
sjFybpWh.setFybpId(id);
List<SjFybpWh> sjFybpWhs = sjFybpWhMapper.selectSjFybpWhList(sjFybpWh); List<SjFybpWh> sjFybpWhs = sjFybpWhMapper.selectSjFybpWhList(sjFybpWh);
sjFybp.setSjFybpWhList(sjFybpWhs); sjFybp.setSjFybpWhList(sjFybpWhs);
//查询文档 //查询文档
...@@ -201,6 +202,23 @@ public class SjFybpServiceImpl implements ISjFybpService ...@@ -201,6 +202,23 @@ public class SjFybpServiceImpl implements ISjFybpService
return AjaxResult.success(sjFybpMapper.tjtbByfylx(sjFybp)); return AjaxResult.success(sjFybpMapper.tjtbByfylx(sjFybp));
} }
@Override
// @DataScope(deptAlias = "d")
public List<SjFybp> getFygz(SjFybp sjFybp) {
return sjFybpMapper.getFygz(sjFybp);
}
@Override
public SjFybp getFygzById(Long id) {
SjFybp sjFybp = sjFybpMapper.getFygzById(id);
//查询费用维护
SjFybpWh sjFybpWh=new SjFybpWh();
sjFybpWh.setFybpId(id);
List<SjFybpWh> sjFybpWhs = sjFybpWhMapper.selectSjFybpWhList(sjFybpWh);
sjFybp.setSjFybpWhList(sjFybpWhs);
return sjFybp;
}
/** /**
* 新增三基-费用维护信息 * 新增三基-费用维护信息
* *
......
package com.qianhe.service.impl;
import java.math.BigDecimal;
import java.util.List;
import com.qianhe.common.annotation.DataScope;
import com.qianhe.common.utils.DateUtils;
import com.qianhe.common.utils.SecurityUtils;
import com.qianhe.domain.SjFybpWh;
import com.qianhe.domain.WdWdxx;
import com.qianhe.mapper.SjFybpMapper;
import com.qianhe.mapper.WdWdxxMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import com.qianhe.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import com.qianhe.domain.SjFybp;
import com.qianhe.mapper.SjFybpZbMapper;
import com.qianhe.domain.SjFybpZb;
import com.qianhe.service.ISjFybpZbService;
/**
* 三基-费用报批主Service业务层处理
*
* @author qianhe
* @date 2024-07-11
*/
@Service
public class SjFybpZbServiceImpl implements ISjFybpZbService
{
@Autowired
private SjFybpZbMapper sjFybpZbMapper;
@Autowired
private SjFybpMapper sjFybpMapper;
@Autowired
private WdWdxxMapper wdWdxxMapper;
/**
* 查询三基-费用报批主
*
* @param id 三基-费用报批主主键
* @return 三基-费用报批主
*/
@Override
public SjFybpZb selectSjFybpZbById(Long id)
{
SjFybpZb sjFybpZb = sjFybpZbMapper.selectSjFybpZbById(id);
//查询从表
List<SjFybp> sjFybpList=sjFybpMapper.selectSjFybpByZbId(id);
sjFybpZb.setSjFybpList(sjFybpList);
//查询文件
//查询文档
WdWdxx wdWdxx=new WdWdxx();
wdWdxx.setGlId(sjFybpZb.getId().toString());
wdWdxx.setMkmc("费用报批");
wdWdxx.setFjlx("费用上报");
List<WdWdxx> wdWdxxes = wdWdxxMapper.selectWdWdxxList(wdWdxx);
sjFybpZb.setFileList(wdWdxxes);
return sjFybpZb;
}
/**
* 查询三基-费用报批主列表
*
* @param sjFybpZb 三基-费用报批主
* @return 三基-费用报批主
*/
@Override
@DataScope(deptAlias = "d")
public List<SjFybpZb> selectSjFybpZbList(SjFybpZb sjFybpZb)
{
return sjFybpZbMapper.selectSjFybpZbList(sjFybpZb);
}
/**
* 新增三基-费用报批主
*
* @param sjFybpZb 三基-费用报批主
* @return 结果
*/
@Transactional
@Override
public int insertSjFybpZb(SjFybpZb sjFybpZb)
{
//保存金额
if(StringUtils.isNotEmpty(sjFybpZb.getSjFybpList())){
//统计已结算金额
BigDecimal reduce = sjFybpZb.getSjFybpList().stream().map(SjFybp::getFyje).reduce(BigDecimal.ZERO, BigDecimal::add);
sjFybpZb.setFyje(reduce);
}
sjFybpZb.setCreateTime(DateUtils.getNowDate());
int rows = sjFybpZbMapper.insertSjFybpZb(sjFybpZb);
insertSjFybp(sjFybpZb);
//保存文件
if(StringUtils.isNotEmpty(sjFybpZb.getFileList())){
if(sjFybpZb.getFileList().size()>0){
sjFybpZb.getFileList().forEach(file->{
file.setGlId(sjFybpZb.getId().toString());
file.setMkmc("费用报批");
file.setFjlx("费用上报");
file.setLrr(SecurityUtils.getUsername());
wdWdxxMapper.insertWdWdxx(file);
});
}
}
return rows;
}
/**
* 修改三基-费用报批主
*
* @param sjFybpZb 三基-费用报批主
* @return 结果
*/
@Transactional
@Override
public int updateSjFybpZb(SjFybpZb sjFybpZb)
{
//先删除文件
wdWdxxMapper.deleteWdWdxxByGlIdAndMkmc(sjFybpZb.getId()+"","费用报批");
//保存文件
if(StringUtils.isNotEmpty(sjFybpZb.getFileList())){
if(sjFybpZb.getFileList().size()>0){
sjFybpZb.getFileList().forEach(file->{
file.setGlId(sjFybpZb.getId().toString());
file.setMkmc("费用报批");
file.setFjlx("费用上报");
file.setLrr(SecurityUtils.getUsername());
wdWdxxMapper.insertWdWdxx(file);
});
}
}
//保存金额
if(StringUtils.isNotEmpty(sjFybpZb.getSjFybpList())){
//统计已结算金额
BigDecimal reduce = sjFybpZb.getSjFybpList().stream().map(SjFybp::getFyje).reduce(BigDecimal.ZERO, BigDecimal::add);
sjFybpZb.setFyje(reduce);
}
sjFybpZb.setUpdateTime(DateUtils.getNowDate());
sjFybpZbMapper.deleteSjFybpByZbId(sjFybpZb.getId());
insertSjFybp(sjFybpZb);
return sjFybpZbMapper.updateSjFybpZb(sjFybpZb);
}
/**
* 批量删除三基-费用报批主
*
* @param ids 需要删除的三基-费用报批主主键
* @return 结果
*/
@Transactional
@Override
public int deleteSjFybpZbByIds(Long[] ids)
{
sjFybpZbMapper.deleteSjFybpByZbIds(ids);
return sjFybpZbMapper.deleteSjFybpZbByIds(ids);
}
/**
* 删除三基-费用报批主信息
*
* @param id 三基-费用报批主主键
* @return 结果
*/
@Transactional
@Override
public int deleteSjFybpZbById(Long id)
{
sjFybpZbMapper.deleteSjFybpByZbId(id);
return sjFybpZbMapper.deleteSjFybpZbById(id);
}
@Override
public int tj(SjFybpZb sjFybpZb) {
return sjFybpZbMapper.updateSjFybpZb(sjFybpZb);
}
/**
* 新增三基-费用报批信息
*
* @param sjFybpZb 三基-费用报批主对象
*/
public void insertSjFybp(SjFybpZb sjFybpZb)
{
List<SjFybp> sjFybpList = sjFybpZb.getSjFybpList();
Long id = sjFybpZb.getId();
if (StringUtils.isNotNull(sjFybpList))
{
List<SjFybp> list = new ArrayList<SjFybp>();
for (SjFybp sjFybp : sjFybpList)
{
sjFybp.setZbId(id);
list.add(sjFybp);
}
if (list.size() > 0)
{
sjFybpZbMapper.batchSjFybp(list);
}
}
}
}
...@@ -83,8 +83,8 @@ public class SjLhscServiceImpl implements ISjLhscService ...@@ -83,8 +83,8 @@ public class SjLhscServiceImpl implements ISjLhscService
sjLhsc.setCreateTime(DateUtils.getNowDate()); sjLhsc.setCreateTime(DateUtils.getNowDate());
sjLhsc.setCreateBy(SecurityUtils.getUsername()); sjLhsc.setCreateBy(SecurityUtils.getUsername());
int rows = sjLhscMapper.insertSjLhsc(sjLhsc); int rows = sjLhscMapper.insertSjLhsc(sjLhsc);
if(StringUtils.isNotEmpty(sjLhsc.getCzwt())){ if(StringUtils.isNotEmpty(sjLhsc.getJjwt())){
String[] split = sjLhsc.getCzwt().split("/(?<=\\d)(?=[.:,、\\s])/"); String[] split = sjLhsc.getJjwt().split("/(?<=\\d)(?=[.:,、\\s])/");
sjLhsc.setWtList(Arrays.asList(split)); sjLhsc.setWtList(Arrays.asList(split));
} }
insertSjLhscWtString(sjLhsc); insertSjLhscWtString(sjLhsc);
...@@ -116,7 +116,7 @@ public class SjLhscServiceImpl implements ISjLhscService ...@@ -116,7 +116,7 @@ public class SjLhscServiceImpl implements ISjLhscService
{ {
//先删除文件 //先删除文件
wdWdxxMapper.deleteWdWdxxByGlIdAndMkmc(sjLhsc.getId()+"","费用报批"); wdWdxxMapper.deleteWdWdxxByGlIdAndMkmc(sjLhsc.getId()+"","例会上传");
//保存文件 //保存文件
if(StringUtils.isNotEmpty(sjLhsc.getFileList())){ if(StringUtils.isNotEmpty(sjLhsc.getFileList())){
if(sjLhsc.getFileList().size()>0){ if(sjLhsc.getFileList().size()>0){
...@@ -134,8 +134,8 @@ public class SjLhscServiceImpl implements ISjLhscService ...@@ -134,8 +134,8 @@ public class SjLhscServiceImpl implements ISjLhscService
sjLhsc.setUpdateBy(SecurityUtils.getUsername()); sjLhsc.setUpdateBy(SecurityUtils.getUsername());
sjLhscMapper.deleteSjLhscWtByLhscId(sjLhsc.getId()); sjLhscMapper.deleteSjLhscWtByLhscId(sjLhsc.getId());
// insertSjLhscWt(sjLhsc); // insertSjLhscWt(sjLhsc);
if(StringUtils.isNotEmpty(sjLhsc.getCzwt())){ if(StringUtils.isNotEmpty(sjLhsc.getJjwt())){
String[] split = sjLhsc.getCzwt().split("/(?<=\\d)(?=[.:,、\\s])/"); String[] split = sjLhsc.getJjwt().split("/(?<=\\d)(?=[.:,、\\s])/");
sjLhsc.setWtList(Arrays.asList(split)); sjLhsc.setWtList(Arrays.asList(split));
} }
insertSjLhscWtString(sjLhsc); insertSjLhscWtString(sjLhsc);
...@@ -184,6 +184,12 @@ public class SjLhscServiceImpl implements ISjLhscService ...@@ -184,6 +184,12 @@ public class SjLhscServiceImpl implements ISjLhscService
return sjLhscMapper.tjBysfsc(vo); return sjLhscMapper.tjBysfsc(vo);
} }
@Override
@DataScope(deptAlias = "d")
public List<SjLhscVo> tjByEjJjwtSl(SjLhscVo vo) {
return sjLhscMapper.tjByEjJjwtSl(vo);
}
/** /**
* 新增三基-例会上传-存在问题信息 * 新增三基-例会上传-存在问题信息
* *
......
...@@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="SjFybp" id="SjFybpResult"> <resultMap type="SjFybp" id="SjFybpResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="zbId" column="zb_id" />
<result property="fymc" column="fymc" /> <result property="fymc" column="fymc" />
<result property="fyrq" column="fyrq" /> <result property="fyrq" column="fyrq" />
<result property="deptId" column="dept_id" /> <result property="deptId" column="dept_id" />
...@@ -37,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -37,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="ysyjezh" column="ysyjezh" /> <result property="ysyjezh" column="ysyjezh" />
<result property="sprName" column="spr_name" /> <result property="sprName" column="spr_name" />
<result property="spzt" column="spzt" /> <result property="spzt" column="spzt" />
<result property="fyzje" column="fyzje" />
</resultMap> </resultMap>
...@@ -59,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -59,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectSjFybpVo"> <sql id="selectSjFybpVo">
select id, select id,
zb_id
fymc, fymc,
fyrq, fyrq,
a.dept_id, a.dept_id,
...@@ -95,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -95,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectSjFybpVo"/> <include refid="selectSjFybpVo"/>
<where> <where>
<if test="fymc != null and fymc != ''"> and fymc like concat('%', #{fymc}, '%')</if> <if test="fymc != null and fymc != ''"> and fymc like concat('%', #{fymc}, '%')</if>
<if test="zbId != null "> and zb_id = #{zbId}</if>
<if test="fyrq != null and fyrq != ''"> and fyrq = #{fyrq}</if> <if test="fyrq != null and fyrq != ''"> and fyrq = #{fyrq}</if>
<if test="deptId != null and deptId != ''"> and (a.dept_id = #{deptId} or find_in_set(#{deptId},d.ancestors))</if> <if test="deptId != null and deptId != ''"> and (a.dept_id = #{deptId} or find_in_set(#{deptId},d.ancestors))</if>
<if test="fylx != null and fylx != ''"> and fylx = #{fylx}</if> <if test="fylx != null and fylx != ''"> and fylx = #{fylx}</if>
...@@ -130,7 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -130,7 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.tjr, a.tjrq, a.sprq, a.spr, a.pfje, a.tjr, a.tjrq, a.sprq, a.spr, a.pfje,
a.ysyje, a.spyj, a.create_by, a.ysyje, a.spyj, a.create_by,
a.create_time, a.update_by, a.update_time, a.create_time, a.update_by, a.update_time,
a.remark, a.yl1, a.yl2, a.yl3, a.yl4, a.yl5,d.dept_name a.remark, a.yl1, a.yl2, a.yl3, a.yl4, a.yl5,d.dept_name, a.zb_id
from sj_fybp a from sj_fybp a
left join sys_dept d on a.dept_id=d.dept_id left join sys_dept d on a.dept_id=d.dept_id
where a.id = #{id} where a.id = #{id}
...@@ -161,6 +165,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -161,6 +165,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
${params.dataScope} ${params.dataScope}
group by a.fylx group by a.fylx
</select> </select>
<select id="selectSjFybpByZbId" resultMap="SjFybpResult">
select a.id, a.fymc, a.fyrq, a.dept_id,
a.fylx, a.fyms, a.fyje, a.fjid, a.zt,
a.tjr, a.tjrq, a.sprq, a.spr, a.pfje,
a.ysyje, a.spyj, a.create_by,
a.create_time, a.update_by, a.update_time,
a.remark, a.yl1, a.yl2, a.yl3, a.yl4, a.yl5, a.zb_id
from sj_fybp a
where a.zb_id = #{zbid}
</select>
<select id="getFygz" 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
left join sj_fybp b on a.id=b.zb_id
left join sj_fybp_wh c on b.id=c.fybp_id
left join sys_dept d on a.dept_id=d.dept_id
where 1=1
<if test="deptId != null and deptId != ''"> and (a.dept_id = #{deptId} or find_in_set(#{deptId},d.ancestors))</if>
<if test="fylx != null and fylx != ''"> and b.fylx = #{fylx}</if>
<if test="fymc != null and fymc != ''"> and b.fymc like concat('%', #{fymc}, '%')</if>
<if test="fyrq != null and fyrq != ''"> and a.fyrq = #{fyrq}</if>
group by 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
left join sj_fybp b on a.id=b.zb_id
left join sj_fybp_wh c on b.id=c.fybp_id
left join sys_dept d on a.dept_id=d.dept_id
where 1=1
and b.id=#{id}
group by b.id
</select>
<insert id="insertSjFybp" parameterType="SjFybp" useGeneratedKeys="true" keyProperty="id"> <insert id="insertSjFybp" parameterType="SjFybp" useGeneratedKeys="true" keyProperty="id">
insert into sj_fybp insert into sj_fybp
...@@ -190,6 +227,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -190,6 +227,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="yl4 != null">yl4,</if> <if test="yl4 != null">yl4,</if>
<if test="yl5 != null">yl5,</if> <if test="yl5 != null">yl5,</if>
<if test="tjrq != null">tjrq,</if> <if test="tjrq != null">tjrq,</if>
<if test="zbId != null">zb_id,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fymc != null">#{fymc},</if> <if test="fymc != null">#{fymc},</if>
...@@ -217,6 +255,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -217,6 +255,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="yl4 != null">#{yl4},</if> <if test="yl4 != null">#{yl4},</if>
<if test="yl5 != null">#{yl5},</if> <if test="yl5 != null">#{yl5},</if>
<if test="tjrq != null">#{tjrq},</if> <if test="tjrq != null">#{tjrq},</if>
<if test="zbId != null">#{zbId},</if>
</trim> </trim>
</insert> </insert>
...@@ -248,6 +287,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -248,6 +287,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="yl4 != null">yl4 = #{yl4},</if> <if test="yl4 != null">yl4 = #{yl4},</if>
<if test="yl5 != null">yl5 = #{yl5},</if> <if test="yl5 != null">yl5 = #{yl5},</if>
<if test="tjrq != null">tjrq = #{tjrq},</if> <if test="tjrq != null">tjrq = #{tjrq},</if>
<if test="zbId != null">zb_id = #{zbId},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qianhe.mapper.SjFybpZbMapper">
<resultMap type="SjFybpZb" id="SjFybpZbResult">
<result property="id" column="id" />
<result property="fyrq" column="fyrq" />
<result property="deptId" column="dept_id" />
<result property="fyje" column="fyje" />
<result property="zt" column="zt" />
<result property="tjr" column="tjr" />
<result property="tjrq" column="tjrq" />
<result property="sprq" column="sprq" />
<result property="spr" column="spr" />
<result property="ysyje" column="ysyje" />
<result property="spyj" column="spyj" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="yl1" column="yl1" />
<result property="yl2" column="yl2" />
<result property="yl3" column="yl3" />
<result property="yl4" column="yl4" />
<result property="yl5" column="yl5" />
<result property="deptName" column="dept_name" />
<result property="sprName" column="spr_name" />
</resultMap>
<resultMap id="SjFybpZbSjFybpResult" type="SjFybpZb" extends="SjFybpZbResult">
<collection property="sjFybpList" notNullColumn="sub_id" javaType="java.util.List" resultMap="SjFybpResult" />
</resultMap>
<resultMap type="SjFybp" id="SjFybpResult">
<result property="id" column="sub_id" />
<result property="fymc" column="sub_fymc" />
<result property="fyrq" column="sub_fyrq" />
<result property="deptId" column="sub_dept_id" />
<result property="fylx" column="sub_fylx" />
<result property="fyms" column="sub_fyms" />
<result property="fyje" column="sub_fyje" />
<result property="fjid" column="sub_fjid" />
<result property="zt" column="sub_zt" />
<result property="tjr" column="sub_tjr" />
<result property="tjrq" column="sub_tjrq" />
<result property="sprq" column="sub_sprq" />
<result property="spr" column="sub_spr" />
<result property="pfje" column="sub_pfje" />
<result property="ysyje" column="sub_ysyje" />
<result property="spyj" column="sub_spyj" />
<result property="createBy" column="sub_create_by" />
<result property="createTime" column="sub_create_time" />
<result property="updateBy" column="sub_update_by" />
<result property="updateTime" column="sub_update_time" />
<result property="remark" column="sub_remark" />
<result property="yl1" column="sub_yl1" />
<result property="yl2" column="sub_yl2" />
<result property="yl3" column="sub_yl3" />
<result property="yl4" column="sub_yl4" />
<result property="yl5" column="sub_yl5" />
<result property="zbId" column="sub_zb_id" />
</resultMap>
<sql id="selectSjFybpZbVo">
select id,
fyrq,
a.dept_id,
fyje,
zt,
tjr,
tjrq,
sprq,
spr,
ysyje,
spyj,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.remark,
yl1,
yl2,
yl3,
yl4,
yl5,
d.dept_name,
u.user_name spr_name
from sj_fybp_zb a
left join sys_dept d on a.dept_id=d.dept_id
left join sys_user u on a.spr=u.user_name
</sql>
<select id="selectSjFybpZbList" parameterType="SjFybpZb" resultMap="SjFybpZbResult">
<include refid="selectSjFybpZbVo"/>
<where>
<if test="fyrq != null and fyrq != ''"> and fyrq = #{fyrq}</if>
<if test="deptId != null and deptId != ''"> and (a.dept_id = #{deptId} or find_in_set(#{deptId},d.ancestors))</if>
<if test="fyje != null "> and fyje = #{fyje}</if>
<if test="zt != null and zt != ''"> and zt = #{zt}</if>
<if test="tjr != null and tjr != ''"> and tjr = #{tjr}</if>
<if test="tjrq != null and tjrq != ''"> and tjrq = #{tjrq}</if>
<if test="sprq != null and sprq != ''"> and sprq = #{sprq}</if>
<if test="spr != null and spr != ''"> and spr = #{spr}</if>
<if test="ysyje != null "> and ysyje = #{ysyje}</if>
<if test="spyj != null and spyj != ''"> and spyj = #{spyj}</if>
<if test="yl1 != null and yl1 != ''"> and yl1 = #{yl1}</if>
<if test="yl2 != null and yl2 != ''"> and yl2 = #{yl2}</if>
<if test="yl3 != null and yl3 != ''"> and yl3 = #{yl3}</if>
<if test="yl4 != null and yl4 != ''"> and yl4 = #{yl4}</if>
<if test="yl5 != null and yl5 != ''"> and yl5 = #{yl5}</if>
<if test="spcx != null and spcx != '' and spcx=='1'.toString()"> and zt !='未提交'</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
</select>
<select id="selectSjFybpZbById" parameterType="Long" resultMap="SjFybpZbResult">
select a.id, a.fyrq, a.dept_id, a.fyje, a.zt, a.tjr, a.tjrq, a.sprq, a.spr, a.ysyje, a.spyj, a.create_by, a.create_time, a.update_by, a.update_time, a.remark, a.yl1, a.yl2, a.yl3, a.yl4, a.yl5
from sj_fybp_zb a
where a.id = #{id}
</select>
<insert id="insertSjFybpZb" parameterType="SjFybpZb" useGeneratedKeys="true" keyProperty="id">
insert into sj_fybp_zb
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fyrq != null">fyrq,</if>
<if test="deptId != null">dept_id,</if>
<if test="fyje != null">fyje,</if>
<if test="zt != null">zt,</if>
<if test="tjr != null">tjr,</if>
<if test="tjrq != null">tjrq,</if>
<if test="sprq != null">sprq,</if>
<if test="spr != null">spr,</if>
<if test="ysyje != null">ysyje,</if>
<if test="spyj != null">spyj,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="yl1 != null">yl1,</if>
<if test="yl2 != null">yl2,</if>
<if test="yl3 != null">yl3,</if>
<if test="yl4 != null">yl4,</if>
<if test="yl5 != null">yl5,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fyrq != null">#{fyrq},</if>
<if test="deptId != null">#{deptId},</if>
<if test="fyje != null">#{fyje},</if>
<if test="zt != null">#{zt},</if>
<if test="tjr != null">#{tjr},</if>
<if test="tjrq != null">#{tjrq},</if>
<if test="sprq != null">#{sprq},</if>
<if test="spr != null">#{spr},</if>
<if test="ysyje != null">#{ysyje},</if>
<if test="spyj != null">#{spyj},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="yl1 != null">#{yl1},</if>
<if test="yl2 != null">#{yl2},</if>
<if test="yl3 != null">#{yl3},</if>
<if test="yl4 != null">#{yl4},</if>
<if test="yl5 != null">#{yl5},</if>
</trim>
</insert>
<update id="updateSjFybpZb" parameterType="SjFybpZb">
update sj_fybp_zb
<trim prefix="SET" suffixOverrides=",">
<if test="fyrq != null">fyrq = #{fyrq},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="fyje != null">fyje = #{fyje},</if>
<if test="zt != null">zt = #{zt},</if>
<if test="tjr != null">tjr = #{tjr},</if>
<if test="tjrq != null">tjrq = #{tjrq},</if>
<if test="sprq != null">sprq = #{sprq},</if>
<if test="spr != null">spr = #{spr},</if>
<if test="ysyje != null">ysyje = #{ysyje},</if>
<if test="spyj != null">spyj = #{spyj},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="yl1 != null">yl1 = #{yl1},</if>
<if test="yl2 != null">yl2 = #{yl2},</if>
<if test="yl3 != null">yl3 = #{yl3},</if>
<if test="yl4 != null">yl4 = #{yl4},</if>
<if test="yl5 != null">yl5 = #{yl5},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSjFybpZbById" parameterType="Long">
delete from sj_fybp_zb where id = #{id}
</delete>
<delete id="deleteSjFybpZbByIds" parameterType="String">
delete from sj_fybp_zb where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteSjFybpByZbIds" parameterType="String">
delete from sj_fybp where zb_id in
<foreach item="zbId" collection="array" open="(" separator="," close=")">
#{zbId}
</foreach>
</delete>
<delete id="deleteSjFybpByZbId" parameterType="Long">
delete from sj_fybp where zb_id = #{zbId}
</delete>
<insert id="batchSjFybp">
insert into sj_fybp( id, fymc, fyrq, dept_id, fylx, fyms, fyje ,zb_id) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.fymc}, #{item.fyrq}, #{item.deptId}, #{item.fylx}, #{item.fyms}, #{item.fyje}, #{item.zbId})
</foreach>
</insert>
</mapper>
\ No newline at end of file
...@@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSjLhscList" parameterType="SjLhsc" resultMap="SjLhscResult"> <select id="selectSjLhscList" parameterType="SjLhsc" resultMap="SjLhscResult">
<include refid="selectSjLhscVo"/> <include refid="selectSjLhscVo"/>
<where> <where>
<if test="hymc != null and hymc != ''"> and hymc = #{hymc}</if> <if test="hymc != null and hymc != ''"> and hymc like concat('%', #{hymc}, '%')</if>
<if test="hyrq != null and hyrq != ''"> and hyrq = #{hyrq}</if> <if test="hyrq != null and hyrq != ''"> and hyrq = #{hyrq}</if>
<if test="deptId != null and deptId != ''"> and a.dept_id = #{deptId}</if> <if test="deptId != null and deptId != ''"> and a.dept_id = #{deptId}</if>
<if test="hydd != null and hydd != ''"> and hydd = #{hydd}</if> <if test="hydd != null and hydd != ''"> and hydd = #{hydd}</if>
...@@ -108,6 +108,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -108,6 +108,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
${params.dataScope} ${params.dataScope}
group by d.dept_id group by d.dept_id
</select> </select>
<select id="tjByEjJjwtSl" resultType="com.qianhe.domain.Vo.SjLhscVo">
select d.dept_id,d.dept_name,count(wt.id) jjwtsl
from sys_dept d
left join sj_lhsc lh on d.dept_id =lh.dept_id
left join sj_lhsc_wt wt on lh.id=wt.lhsc_id
where d.dwjb =#{dwjb}
<if test="deptId != null and deptId != ''"> and lh.dept_id = #{deptId}</if>
<if test="startJd !=null and startJd !=''"> and DATE_FORMAT(hyrq,'%Y-%m')>=#{startJd} </if>
<if test="endJd !=null and endJd !=''"> and DATE_FORMAT(hyrq,'%Y-%m')&lt;=#{endJd} </if>
<!-- 数据范围过滤 -->
${params.dataScope}
group by d.dept_id
</select>
<insert id="insertSjLhsc" parameterType="SjLhsc" useGeneratedKeys="true" keyProperty="id"> <insert id="insertSjLhsc" parameterType="SjLhsc" useGeneratedKeys="true" keyProperty="id">
......
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