parent
a57254ac8b
commit
84a979b1df
@ -0,0 +1,40 @@
|
||||
package com.ruoyi.jjh.declaration.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.jjh.declaration.entity.BmsOutQuitProducts;
|
||||
import com.ruoyi.jjh.declaration.entity.BmsOutQuitProducts;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 2024年度淘汰落后和退出低端低效产能装备清单 Mapper接口
|
||||
*
|
||||
* @author farben
|
||||
* @date 2023-09-04
|
||||
*/
|
||||
public interface BmsOutQuitProductsMapper extends BaseMapper<BmsOutQuitProducts> {
|
||||
|
||||
/**
|
||||
* 查询2024年度淘汰落后和退出低端低效产能装备清单列表
|
||||
*
|
||||
* @param bmsCreditManagement 信用管理奖补
|
||||
* @return 信用管理奖补集合
|
||||
*/
|
||||
List<BmsOutQuitProducts> selectBmsOutQuitProductsList(BmsOutQuitProducts bmsCreditManagement);
|
||||
|
||||
/**
|
||||
* 删除2024年度淘汰落后和退出低端低效产能装备清单
|
||||
*
|
||||
* @param id 信用管理奖补主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteBmsOutQuitProductsById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除2024年度淘汰落后和退出低端低效产能装备清单
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteBmsOutQuitProductsByIds(Long[] ids);
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package com.ruoyi.jjh.declaration.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.jjh.declaration.entity.BmsBigStrongAward;
|
||||
import com.ruoyi.jjh.declaration.entity.BmsOutQuitProducts;
|
||||
import com.ruoyi.jjh.declaration.entity.dto.BmsBigStrongAwardAddDto;
|
||||
import com.ruoyi.jjh.declaration.entity.dto.BmsBigStrongAwardUpdateDto;
|
||||
import com.ruoyi.jjh.declaration.entity.dto.BmsOutQuitProductsAddDto;
|
||||
import com.ruoyi.jjh.declaration.entity.dto.BmsOutQuitProductsUpdateDto;
|
||||
import com.ruoyi.jjh.declaration.entity.vo.BmsBigStrongAwardQueryVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 2024年度淘汰落后和退出低端低效产能装备清单Service接口
|
||||
*
|
||||
* @author farben
|
||||
* @date 2023-08-25
|
||||
*/
|
||||
public interface IBmsOutQuitProductsService extends IService<BmsOutQuitProducts> {
|
||||
|
||||
/**
|
||||
* 查询2024年度淘汰落后和退出低端低效产能装备清单列表
|
||||
*
|
||||
* @param bmsOutQuitProducts 详情
|
||||
* @return 详情集合
|
||||
*/
|
||||
List<BmsOutQuitProducts> selectBmsOutQuitProductsList(BmsOutQuitProducts bmsOutQuitProducts);
|
||||
|
||||
/**
|
||||
* 新增2024年度淘汰落后和退出低端低效产能装备清单
|
||||
*
|
||||
* @param bmsOutQuitProductsAddDto 详情
|
||||
* @return 结果
|
||||
*/
|
||||
int insertBmsOutQuitProducts(BmsOutQuitProductsAddDto bmsOutQuitProductsAddDto);
|
||||
|
||||
/**
|
||||
* otherJson
|
||||
*/
|
||||
Map<String,String> getAllJson(Long id);
|
||||
|
||||
/**
|
||||
* 修改2024年度淘汰落后和退出低端低效产能装备清单
|
||||
*
|
||||
* @param bmsOutQuitProductsUpdateDto 详情
|
||||
* @return 结果
|
||||
*/
|
||||
int updateBmsOutQuitProducts(BmsOutQuitProductsUpdateDto bmsOutQuitProductsUpdateDto);
|
||||
|
||||
/**
|
||||
* 批量删除2024年度淘汰落后和退出低端低效产能装备清单
|
||||
*
|
||||
* @param ids 主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteBmsOutQuitProductsByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除2024年度淘汰落后和退出低端低效产能装备清单
|
||||
*
|
||||
* @param id 详情主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteBmsOutQuitProductsById(Long id);
|
||||
}
|
@ -0,0 +1,167 @@
|
||||
package com.ruoyi.jjh.declaration.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.jjh.declaration.entity.BmsDeclarationRecords;
|
||||
import com.ruoyi.jjh.declaration.entity.BmsManufacturingServicesAward;
|
||||
import com.ruoyi.jjh.declaration.entity.BmsOutQuitProducts;
|
||||
import com.ruoyi.jjh.declaration.entity.BmsPlatformConstructionAward;
|
||||
import com.ruoyi.jjh.declaration.entity.dto.BmsBigStrongAwardAddDto;
|
||||
import com.ruoyi.jjh.declaration.entity.dto.BmsBigStrongAwardUpdateDto;
|
||||
import com.ruoyi.jjh.declaration.entity.dto.BmsOutQuitProductsAddDto;
|
||||
import com.ruoyi.jjh.declaration.entity.dto.BmsOutQuitProductsUpdateDto;
|
||||
import com.ruoyi.jjh.declaration.entity.vo.BmsBigStrongAwardQueryVo;
|
||||
import com.ruoyi.jjh.declaration.entity.vo.DeclarationRecordsVo;
|
||||
import com.ruoyi.jjh.declaration.mapper.BmsOutQuitProductsMapper;
|
||||
import com.ruoyi.jjh.declaration.service.IBmsDeclarationRecordsService;
|
||||
import com.ruoyi.jjh.declaration.service.IBmsOutQuitProductsService;
|
||||
import com.ruoyi.jjh.declaration.service.IBmsTemplateInfoService;
|
||||
import com.ruoyi.jjh.declaration.service.ICommonService;
|
||||
import com.ruoyi.jjh.ent.service.JProjectService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 2024年度淘汰落后和退出低端低效产能装备清单Service业务层处理
|
||||
*
|
||||
* @author farben
|
||||
* @date 2023-08-25
|
||||
*/
|
||||
@Service
|
||||
public class BmsOutQuitProductsServiceImpl extends ServiceImpl<BmsOutQuitProductsMapper,BmsOutQuitProducts> implements IBmsOutQuitProductsService {
|
||||
|
||||
@Autowired
|
||||
private ICommonService iCommonService;
|
||||
|
||||
@Autowired
|
||||
private IBmsDeclarationRecordsService iBmsDeclarationRecordsService;
|
||||
@Resource
|
||||
private IBmsTemplateInfoService iBmsTemplateInfoService;
|
||||
@Resource
|
||||
private JProjectService jProjectService;
|
||||
/**
|
||||
* 查询2024年度淘汰落后和退出低端低效产能装备清单列表
|
||||
*
|
||||
* @param bmsOutQuitProducts 详情
|
||||
* @return 详情集合
|
||||
*/
|
||||
@Override
|
||||
public List<BmsOutQuitProducts> selectBmsOutQuitProductsList(BmsOutQuitProducts bmsOutQuitProducts) {
|
||||
return baseMapper.selectBmsOutQuitProductsList(bmsOutQuitProducts);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增2024年度淘汰落后和退出低端低效产能装备清单
|
||||
*
|
||||
* @param bmsOutQuitProductsAddDto 详情
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBmsOutQuitProducts(BmsOutQuitProductsAddDto bmsOutQuitProductsAddDto) {
|
||||
Long enterpriseId = iCommonService.checkEnterprise(bmsOutQuitProductsAddDto.getCreditCode()
|
||||
,bmsOutQuitProductsAddDto.getTemplateRecordId());
|
||||
// check 申报信息
|
||||
iCommonService.checkDeclaration(bmsOutQuitProductsAddDto.getCreditCode()
|
||||
,bmsOutQuitProductsAddDto.getTemplateRecordId());
|
||||
|
||||
BmsOutQuitProducts products = new BmsOutQuitProducts();
|
||||
BeanUtil.copyProperties(bmsOutQuitProductsAddDto,products);
|
||||
products.setEnterpriseId(enterpriseId);
|
||||
int num = baseMapper.insert(products);
|
||||
|
||||
// 新增申请记录
|
||||
BmsDeclarationRecords declarationRecords = new BmsDeclarationRecords();
|
||||
declarationRecords.setMatter("提交2024年度淘汰落后和退出低端低效产能装备清单");
|
||||
declarationRecords.setDetailId(products.getId());
|
||||
declarationRecords.setStatus(1L);
|
||||
declarationRecords.setId(bmsOutQuitProductsAddDto.getDeclarationId());
|
||||
iBmsDeclarationRecordsService.updateById(declarationRecords);
|
||||
|
||||
//新增项目
|
||||
declarationRecords.setJjhProjectId(jProjectService.saveProject(getAllJson(bmsOutQuitProductsAddDto.getDeclarationId())));
|
||||
iBmsDeclarationRecordsService.updateById(declarationRecords);
|
||||
|
||||
// 生成审核
|
||||
iCommonService.insertAuditRecord(declarationRecords.getId(),0);
|
||||
return num;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getAllJson(Long id) {
|
||||
Map<String,String> jsonMap = new HashMap<>();
|
||||
//获取该申报记录的详情
|
||||
DeclarationRecordsVo declarationRecordsVo = iBmsDeclarationRecordsService.selectBmsDeclarationRecordsById(id);
|
||||
//申报的企业信息JSON
|
||||
String js1= JSONObject.toJSONString(declarationRecordsVo.getBmsEnterpriseBasicInfo());
|
||||
//在线申报信息JSON
|
||||
String js2 = JSONObject.toJSONString(declarationRecordsVo.getBmsDeclarationRecords());
|
||||
//提交2024年度淘汰落后和退出低端低效产能装备清单
|
||||
BmsOutQuitProducts p1 = declarationRecordsVo.getBmsOutQuitProducts();
|
||||
//提交2024年度淘汰落后和退出低端低效产能装备清单json
|
||||
String js3 = JSONObject.toJSONString(p1);
|
||||
jsonMap.put("credit_code",declarationRecordsVo.getBmsEnterpriseBasicInfo().getCreditCode());
|
||||
jsonMap.put("projectName",declarationRecordsVo.getBmsDeclarationRecords().getProjectName());
|
||||
jsonMap.put("year",declarationRecordsVo.getBmsDeclarationRecords().getYear());
|
||||
jsonMap.put("templateId", String.valueOf(declarationRecordsVo.getBmsDeclarationRecords().getTemplateId()));
|
||||
jsonMap.put("otherJson",jProjectService.allJsonString(js1, js2, js3, "{}"));
|
||||
jsonMap.put("fileJson", "{" +
|
||||
'"' + "拟淘汰或退出生产工艺装备情况" + '"' + ":" + '"' + p1.getSpecifics() + '"' + "," +
|
||||
'"' + "其他相关情况说明" + '"' + ":" + '"' + p1.getOtherSpecifics() + '"'+
|
||||
"}");
|
||||
jsonMap.put("declareUnit",declarationRecordsVo.getBmsEnterpriseBasicInfo().getEnterpriseName());
|
||||
jsonMap.put("jjhProjectId", String.valueOf(declarationRecordsVo.getBmsDeclarationRecords().getJjhProjectId()));
|
||||
return jsonMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBmsOutQuitProducts(BmsOutQuitProductsUpdateDto bmsOutQuitProductsUpdateDto) {
|
||||
int num = 0;
|
||||
try {
|
||||
BmsDeclarationRecords newRecord = new BmsDeclarationRecords();
|
||||
newRecord.setId(bmsOutQuitProductsUpdateDto.getDeclarationRecordsId());
|
||||
newRecord.setStatus(bmsOutQuitProductsUpdateDto.getStatus());
|
||||
iBmsDeclarationRecordsService.updateById(newRecord);
|
||||
|
||||
num = baseMapper.updateById(bmsOutQuitProductsUpdateDto);
|
||||
// 申请审批
|
||||
if (bmsOutQuitProductsUpdateDto.getStatus()==1){
|
||||
Map<String, String> allJson = getAllJson(bmsOutQuitProductsUpdateDto.getDeclarationRecordsId());
|
||||
//修改项目
|
||||
jProjectService.updateTheJson(allJson);
|
||||
// 审批状态
|
||||
iCommonService.updateAuditRecord(bmsOutQuitProductsUpdateDto.getDeclarationRecordsId(), 0);
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return num;
|
||||
}
|
||||
/**
|
||||
* 批量删除2024年度淘汰落后和退出低端低效产能装备清单
|
||||
*
|
||||
* @param ids 主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBmsOutQuitProductsByIds(Long[] ids) {
|
||||
return baseMapper.deleteBmsOutQuitProductsByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除2024年度淘汰落后和退出低端低效产能装备清单
|
||||
*
|
||||
* @param id 详情主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBmsOutQuitProductsById(Long id) {
|
||||
return baseMapper.deleteBmsOutQuitProductsById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
<?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.ruoyi.jjh.declaration.mapper.BmsOutQuitProductsMapper">
|
||||
|
||||
<select id="selectBmsOutQuitProductsList" resultType="com.ruoyi.jjh.declaration.entity.BmsOutQuitProducts">
|
||||
select *
|
||||
from bms_out_quit_products
|
||||
<where>
|
||||
<if test="enterpriseId != null ">and enterprise_id = #{enterpriseId}</if>
|
||||
<if test="mainProducts != null and mainProducts != ''">and mainProducts =
|
||||
#{mainProducts}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<delete id="deleteBmsOutQuitProductsById">
|
||||
delete
|
||||
from bms_out_quit_products
|
||||
where id = #{id}
|
||||
</delete>
|
||||
<delete id="deleteBmsOutQuitProductsByIds">
|
||||
delete from bms_out_quit_products where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in new issue