c2ab605c 张雷

Merge remote-tracking branch 'origin/master' into master

2 个父辈 2b709069 6dfd14be
正在显示 19 个修改的文件 包含 324 行增加308 行删除
package com.skua.modules.erp.controller;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.io.IOException;
......@@ -10,16 +11,23 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.query.QueryGenerator;
import com.skua.core.util.ConvertUtils;
import com.skua.core.util.DateUtils;
import com.skua.modules.erp.entity.ErpSettlement;
import com.skua.modules.erp.entity.ErpSettlementItem;
import com.skua.modules.erp.service.IErpSettlementService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.erp.vo.ErpSettlementVO;
import com.skua.modules.productionduty.utils.HolidaysUtils;
import com.skua.modules.quartz.util.BaseUtil;
import io.netty.util.internal.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
......@@ -64,19 +72,26 @@ public class ErpSettlementController {
@GetMapping(value = "/supplierSettlement")
public Result<ErpSettlementVO> supplierSettlement(@RequestParam(name="ids",required=true) String ids) {
Result<ErpSettlementVO> result = new Result<>();
List<ErpSettlementVO> settlementVOList = erpSettlementService.checkSupplierByIds(ids);
ErpSettlementVO erpSettlementVO = null;
List<ErpSettlementVO> settlementVOList = erpSettlementService.supplierSettlement(ids);
if(settlementVOList==null || settlementVOList.isEmpty()) {
result.error500("根据供应商与合同号未找到实体");
return result;
}
String supplierName = "";
if(settlementVOList != null ){
for(ErpSettlementVO settlementVO : settlementVOList){
erpSettlementVO = settlementVO;
if(supplierName.length() >0 ) supplierName+=",";
supplierName += settlementVO.getSupplierName();
}
}
String[] supplierNameList = supplierName.split(",");
if(supplierNameList.length > 1){
result.error500("多个供应商:"+supplierName+";请选择一个供应商");
result.error500("查询多个供应商:"+supplierName+"记录;请选择某一个供应商");
}else{
ErpSettlementVO erpSettlementVO = erpSettlementService.supplierSettlementByMaterialIds(ids);
List<ErpSettlementItem> erpSettlementItemList = erpSettlementService.querySupplierSettlementByMaterialIds(ids);
erpSettlementVO.setItemList( erpSettlementItemList );
result.setResult(erpSettlementVO);
result.setSuccess(true);
}
......@@ -88,20 +103,26 @@ public class ErpSettlementController {
@GetMapping(value = "/waterDepartSettlement")
public Result<ErpSettlementVO> waterDepartSettlement(@RequestParam(name="ids",required=true) String ids) {
Result<ErpSettlementVO> result = new Result<ErpSettlementVO>();
List<ErpSettlementVO> settlementVOList = erpSettlementService.checkSupplierByIds(ids);
ErpSettlementVO erpSettlementVO = null;
List<ErpSettlementVO> settlementVOList = erpSettlementService.waterDepartSettlement(ids);
if(settlementVOList==null || settlementVOList.isEmpty()) {
result.error500("根据部门与合同号未找到实体");
return result;
}
String supplierName = "";
if(settlementVOList != null ){
for(ErpSettlementVO settlementVO : settlementVOList){
erpSettlementVO = settlementVO;
if(supplierName.length() >0 ) supplierName+=",";
supplierName += settlementVO.getSupplierName();
}
}
String[] supplierNameList = supplierName.split(",");
if(supplierNameList.length > 1){
result.error500("多个水厂:"+supplierName+";请选择一个水厂");
result.error500("查询出多个水厂:"+supplierName+"记录;请选择某一个水厂");
}else{
ErpSettlementVO erpSettlementVO = erpSettlementService.waterDepartSettlementByMaterialIds(ids);
List<ErpSettlementItem> settlementItemList = erpSettlementService.queryWaterDepartSettlementByMaterialIds(ids);
erpSettlementVO.setItemList(settlementItemList );
result.setResult(erpSettlementVO);
result.setSuccess(true);
}
......@@ -114,6 +135,12 @@ public class ErpSettlementController {
public Result<ErpSettlementVO> add(@RequestBody ErpSettlementVO erpSettlementVO) {
Result<ErpSettlementVO> result = new Result<ErpSettlementVO>();
try {
if(StringUtils.isEmpty(erpSettlementVO.getApplyTime())){
erpSettlementVO.setApplyTime(DateUtils.format(new Date(), HolidaysUtils.DATE_TIME_PATTERN));
}
if(StringUtils.isEmpty(erpSettlementVO.getApproverSign())){
erpSettlementVO.setApproverSign(BaseContextHandler.getUserName());
}
erpSettlementService.saveSettlement(erpSettlementVO);
result.success("添加成功!");
} catch (Exception e) {
......@@ -139,6 +166,63 @@ public class ErpSettlementController {
}
return result;
}
@AutoLog(value = "药剂结算单详情-验收审批")
@ApiOperation(value="药剂结算单详情-验收审批", notes="药剂结算单详情-验收审批")
@DeleteMapping(value = "/auditAccept")
public Result<?> auditAccept(@RequestParam(name="id",required=true) String id) {
Result<ErpSettlementVO> result = new Result<ErpSettlementVO>();
ErpSettlement erpSettlementEntity = erpSettlementService.getById(id);
erpSettlementEntity.setInspectTime(DateUtils.format(new Date(), HolidaysUtils.DATE_TIME_PATTERN));
erpSettlementEntity.setInspectorSign(BaseContextHandler.getUserName());
if(erpSettlementEntity==null) {
result.error500("未找到对应实体");
}else {
boolean ok = erpSettlementService.updateById(erpSettlementEntity);
if(ok) {
result.success("验收审批成功!");
}
}
return result;
}
@AutoLog(value = "药剂结算单详情-经理审批")
@ApiOperation(value="药剂结算单详情-经理审批", notes="药剂结算单详情-经理审批")
@DeleteMapping(value = "/auditManager")
public Result<?> auditManager(@RequestParam(name="id",required=true) String id) {
Result<ErpSettlementVO> result = new Result<ErpSettlementVO>();
ErpSettlement erpSettlementEntity = erpSettlementService.getById(id);
erpSettlementEntity.setApproveTime(DateUtils.format(new Date(), HolidaysUtils.DATE_TIME_PATTERN));
erpSettlementEntity.setApproverSign(BaseContextHandler.getUserName());
if(erpSettlementEntity==null) {
result.error500("未找到对应实体");
}else {
boolean ok = erpSettlementService.updateById(erpSettlementEntity);
if(ok) {
result.success("审批成功!");
}
}
return result;
}
@AutoLog(value = "药剂结算单详情-结算")
@ApiOperation(value="药剂结算单详情-结算", notes="药剂结算单详情-结算")
@DeleteMapping(value = "/settlement")
public Result<?> settlement(@RequestParam(name="id",required=true) String id) {
Result<ErpSettlementVO> result = new Result<ErpSettlementVO>();
ErpSettlement erpSettlementEntity = erpSettlementService.getById(id);
erpSettlementEntity.setStatus(1);
erpSettlementEntity.setSettlementTime(DateUtils.format(new Date(), HolidaysUtils.DATE_TIME_PATTERN));
if(erpSettlementEntity==null) {
result.error500("未找到对应实体");
}else {
boolean ok = erpSettlementService.updateById(erpSettlementEntity);
if(ok) {
result.success("结算成功!");
}
}
return result;
}
@AutoLog(value = "药剂结算单详情-通过id删除")
@ApiOperation(value="药剂结算单详情-通过id删除", notes="药剂结算单详情-通过id删除")
......@@ -166,7 +250,6 @@ public class ErpSettlementController {
}
return result;
}
@AutoLog(value = "药剂结算单详情-通过id查询")
@ApiOperation(value="药剂结算单详情-通过id查询", notes="药剂结算单详情-通过id查询")
@GetMapping(value = "/queryById")
......@@ -182,7 +265,20 @@ public class ErpSettlementController {
return result;
}
@AutoLog(value = "药剂结算单详情-导出:送货单以及物资验收单")
@ApiOperation(value="药剂结算单详情-导出:送货单以及物资验收单", notes="药剂结算单详情-导出:送货单以及物资验收单")
@GetMapping(value = "/exportSupplierFormPDF")
public Result<ErpSettlementVO> exportSupplierFormPDF(@RequestParam(name="id",required=true) String id) {
Result<ErpSettlementVO> result = new Result<ErpSettlementVO>();
ErpSettlementVO erpSettlement = erpSettlementService.queryById(id);
if(erpSettlement==null) {
result.error500("未找到对应实体");
}else {
result.setResult(erpSettlement);
result.setSuccess(true);
}
return result;
}
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
......
package com.skua.modules.erp.controller;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.context.BaseContextHandler;
......
......@@ -40,12 +40,15 @@ public class ErpSettlement {
private String departId;
/**采购合同*/
@ApiModelProperty(value = "采购合同")
@Dict(dictTable = "erp_purchase_contract", dicCode="id", dicText = "contract_code")
private String purchaseContractId;
/**分销合同*/
@ApiModelProperty(value = "分销合同")
@Dict(dictTable = "erp_distribut_contract", dicCode="id", dicText = "contract_code")
private String distributContractId;
/**合同编号*/
@ApiModelProperty(value = "合同编号")
private String contractCode;
/**数量*/
@Excel(name = "数量", width = 15)
@ApiModelProperty(value = "数量")
......@@ -64,8 +67,8 @@ public class ErpSettlement {
private String totalPriceTax;
/**签字状态(1-申请,2-验收签字,3-经理签字)*/
@Excel(name = "签字状态(1-申请,2-验收签字,3-经理签字)", width = 15)
@ApiModelProperty(value = "签字状态(1-申请,2-验收签字,3-经理签字)")
private Integer signStatus;
@ApiModelProperty(value = "审批状态(1-申请,2-验收签字,3-经理签字)")
private Integer auditStatus;
/**结算状态(0 未结算 1 已结算)*/
@Excel(name = "结算状态(0 未结算 1 已结算)", width = 15)
@ApiModelProperty(value = "结算状态(0 未结算 1 已结算)")
......@@ -74,6 +77,11 @@ public class ErpSettlement {
@Excel(name = "申请时间", width = 15)
@ApiModelProperty(value = "申请时间")
private String applyTime;
@Excel(name = "结算日期", width = 15)
@ApiModelProperty(value = "结算日期")
private String settlementTime;
/**申请人签字*/
@Excel(name = "申请人签字", width = 15)
@ApiModelProperty(value = "申请人签字")
......@@ -94,6 +102,8 @@ public class ErpSettlement {
@Excel(name = "审批签字", width = 15)
@ApiModelProperty(value = "审批签字")
private String approverSign;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
......
......@@ -30,6 +30,9 @@ public class ErpSettlementItem {
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "主键")
private String id;
@ApiModelProperty(value = "药剂入库单编号")
private String materialInId;
/**结算单编号*/
@Excel(name = "结算单编号", width = 15)
@ApiModelProperty(value = "结算单编号")
......@@ -99,19 +102,10 @@ public class ErpSettlementItem {
/**采购合同*/
@ApiModelProperty(value = "采购合同")
@Dict(dictTable = "erp_purchase_contract", dicCode="id", dicText = "contract_code")
private String purchaseContractId;
/**分销合同*/
@ApiModelProperty(value = "分销合同")
@Dict(dictTable = "erp_distribut_contract", dicCode="id", dicText = "contract_code")
private String distributContractId;
@TableField(exist=false)
@ApiModelProperty(value = "供应商id")
private String supplierId;
@TableField(exist=false)
@ApiModelProperty(value = "部门编号")
private String departId;
}
......
......@@ -60,6 +60,12 @@ public class PurchaseMaterial {
@Excel(name = "计量单位", width = 15)
@ApiModelProperty(value = "计量单位")
private String measuringUnit;
@ApiModelProperty(value = "产地")
private String goodOrigin;
@ApiModelProperty(value = "品牌")
private String goodBrand;
/**计划采购数量*/
@Excel(name = "计划采购数量", width = 15)
@ApiModelProperty(value = "计划采购数量")
......
......@@ -12,10 +12,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* 药剂结算单详情
*/
public interface ErpSettlementMapper extends BaseMapper<ErpSettlement> {
//校验供应商
List<ErpSettlementVO> checkSupplierByIds(@Param("ids") String ids);
//校验水厂
List<ErpSettlementVO> checkWaterDepartByIds(@Param("ids")String ids);
// 根据入库单ids,获取结算单
List<ErpSettlementItem> querySettlementByMaterialIds(@Param("ids") String materialIds);
//供应商结算
List<ErpSettlementVO> supplierSettlement(@Param("ids") String ids);
//水厂结算
List<ErpSettlementVO> waterDepartSettlement(@Param("ids")String ids);
// 根据入库单ids,获取【供应商】结算单详情
List<ErpSettlementItem> querySupplierSettlementByMaterialIds(@Param("ids") String materialIds);
// 根据入库单ids,获取【水厂】结算单详情
List<ErpSettlementItem> queryWaterDepartSettlementByMaterialIds(@Param("ids") String materialIds);
}
......
<?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.skua.modules.erp.mapper.ErpSettlementMapper">
<!--校验供应商-->
<select id="checkSupplierByIds" resultType="com.skua.modules.erp.vo.ErpSettlementVO">
select mi.supplier_id , sm.supp_name 'supplier_name' from erp_material_in mi ,ajh_supplier_manage sm
where mi.supplier_id = sm.id
and mi.id in (${ids}) group by mi.supplier_id
</select>
<!-- 校验水厂名称 -->
<select id="checkWaterDepartByIds" resultType="com.skua.modules.erp.vo.ErpSettlementVO">
select mi.depart_id , d.depart_name from erp_material_in mi ,sys_depart d
where mi.depart_id = d.id
and mi.id in (${ids}) group by mi.depart_id
<!--供应商结算 -->
<select id="supplierSettlement" resultType="com.skua.modules.erp.vo.ErpSettlementVO">
select sm.supp_name 'supplierName', d.depart_name ,aaa.* from (
select pm.supplier_id ,pc.contract_code, mi.purchase_contract_id ,pc.project_name, mi.depart_id,
sum(mi.material_num) material_num, round(sum(pm.unit_price * mi.material_num),2) total_price,
round(sum(pm.unit_price * mi.material_num *(100 + pm.tax_amount) /100),2) total_price_tax
from erp_material_in mi ,erp_purchase_contract pc , erp_purchase_material pm
where mi.audit_status = 3 and mi.purchase_contract_id = pc.id and pm.good_code = mi.good_code and pm.contract_id = mi.purchase_contract_id
and mi.id in (${ids})
group by pm.supplier_id ,pc.contract_code
)aaa
left join ajh_supplier_manage sm on aaa.supplier_id = sm.id
left join sys_depart d on aaa.depart_id = d.id
</select>
<!-- 根据入库单ids,获取结算单-->
<select id="querySettlementByMaterialIds" resultType="com.skua.modules.erp.entity.ErpSettlementItem">
select mi.* from erp_material_in mi where mi.id in (${ids}) group by mi.create_time
<!-- 根据入库单ids,获取供应商结算单详情-->
<select id="querySupplierSettlementByMaterialIds" resultType="com.skua.modules.erp.entity.ErpSettlementItem">
select pc.contract_code, mi.purchase_contract_id , pm.unit_price ,mi.material_num, pm.tax_amount ,(pm.unit_price * mi.material_num) total_price,(pm.unit_price * mi.material_num *(100+pm.tax_amount) /100) total_price_tax,
mi.arrive_time ,mi.remark,mi.sparepart_type,mi.sparepart_id,mi.sparepart_name,mi.sparepart_code,mi.specification, mi.measuring_unit,mi.good_code,mi.id 'material_in_id'
from erp_material_in mi ,erp_purchase_contract pc , erp_purchase_material pm
where mi.audit_status = 3 and mi.purchase_contract_id = pc.id and pm.good_code = mi.good_code and pm.contract_id = mi.purchase_contract_id
and mi.id in (${ids})
order by mi.arrive_time asc
</select>
<select id="querySettlementByMaterialIds" resultType="com.skua.modules.erp.entity.ErpSettlementItem">
select mi.* from erp_material_in mi where mi.id in (${ids}) group by mi.create_time
<!--水厂结算 -->
<select id="waterDepartSettlement" resultType="com.skua.modules.erp.vo.ErpSettlementVO">
select d.depart_name ,aaa.* from (
select mi.depart_id ,dc.contract_code, mi.distribut_contract_id ,sum(mi.material_num) material_num, dc.contract_name 'project_name', round(sum(dm.distribut_price * mi.material_num),2) total_price,
round(sum(dm.distribut_price * mi.material_num *(100+dm.tax_amount) /100),2) total_price_tax
from erp_material_in mi ,erp_distribut_contract dc , erp_distribut_material dm
where mi.audit_status = 3 and mi.distribut_contract_id = dc.id and dm.good_code = mi.good_code and dm.contract_id = mi.distribut_contract_id
and mi.id in (${ids})
group by mi.depart_id ,dc.contract_code
)aaa
left join sys_depart d on aaa.depart_id = d.id
</select>
<select id="querySettlementByMaterialIds" resultType="com.skua.modules.erp.entity.ErpSettlementItem">
select mi.* from erp_material_in mi where mi.id in (${ids}) group by mi.create_time
<!-- 根据入库单ids,获取水厂结算单详情-->
<select id="queryWaterDepartSettlementByMaterialIds" resultType="com.skua.modules.erp.entity.ErpSettlementItem">
select dc.contract_code, mi.distribut_contract_id , dm.distribut_price 'unit_price' , mi.material_num, dm.tax_amount ,(dm.distribut_price * mi.material_num) total_price,
(dm.distribut_price * mi.material_num *(100+dm.tax_amount) /100) total_price_tax,
mi.arrive_time ,mi.remark,mi.sparepart_type,mi.sparepart_id,mi.sparepart_name,mi.sparepart_code,mi.specification,
mi.measuring_unit,mi.good_code,mi.id 'material_in_id'
from erp_material_in mi ,erp_distribut_contract dc , erp_distribut_material dm
where mi.audit_status = 3 and mi.distribut_contract_id = dc.id and dm.good_code = mi.good_code and dm.contract_id = mi.distribut_contract_id
and mi.id in (${ids})
order by mi.arrive_time asc
</select>
</mapper>
......
......@@ -2,7 +2,9 @@ package com.skua.modules.erp.service;
import com.skua.modules.erp.entity.ErpSettlement;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skua.modules.erp.entity.ErpSettlementItem;
import com.skua.modules.erp.vo.ErpSettlementVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -10,20 +12,6 @@ import java.util.List;
* 药剂结算单详情
*/
public interface IErpSettlementService extends IService<ErpSettlement> {
/***
* 校验供应商
* @param ids
* @return
*/
List<ErpSettlementVO> checkSupplierByIds(String ids);
/***
* 校验水厂
* @param ids
* @return
*/
List<ErpSettlementVO> checkWaterDepartByIds(String ids);
/**
* 新增结算单
* @param erpSettlementVO
......@@ -42,9 +30,15 @@ public interface IErpSettlementService extends IService<ErpSettlement> {
// 删除
void delById(String id);
//供应商结算清单
ErpSettlementVO supplierSettlementByMaterialIds(String materialIds);
//水厂结束清单
ErpSettlementVO waterDepartSettlementByMaterialIds(String materialIds);
//供应商结算
List<ErpSettlementVO> supplierSettlement(String materialInIds);
// 根据入库单ids,获取【供应商】结算单详情
List<ErpSettlementItem> querySupplierSettlementByMaterialIds(String materialInIds);
//水厂结算
List<ErpSettlementVO> waterDepartSettlement(String materialInIds);
// 根据入库单ids,获取【水厂】结算单详情
List<ErpSettlementItem> queryWaterDepartSettlementByMaterialIds( String materialInIds);
}
......
......@@ -84,63 +84,22 @@ public class ErpSettlementServiceImpl extends ServiceImpl<ErpSettlementMapper, E
settlementItemMapper.deleteBySettlementId(settlementId);
}
/***
* 校验供应商
* @param ids
* @return
*/
public List<ErpSettlementVO> checkSupplierByIds(String ids){
ids = JSUtils.quoteEach(ids,",");
return this.baseMapper.checkSupplierByIds( ids );
//供应商结算
public List<ErpSettlementVO> supplierSettlement(String materialInIds){
return this.baseMapper.supplierSettlement( materialInIds );
}
/***
* 校验水厂
* @param ids
* @return
*/
public List<ErpSettlementVO> checkWaterDepartByIds(String ids){
ids = JSUtils.quoteEach(ids,",");
return this.baseMapper.checkWaterDepartByIds( ids );
//水厂结算
public List<ErpSettlementVO> waterDepartSettlement(String materialInIds){
return this.baseMapper.waterDepartSettlement( materialInIds );
}
//供应商结算清单
public ErpSettlementVO supplierSettlementByMaterialIds(String materialIds){
List<ErpSettlementItem> itemList = this.baseMapper.querySettlementByMaterialIds( materialIds );
ErpSettlementVO erpSettlementVO = new ErpSettlementVO();
if(itemList != null){
for(ErpSettlementItem settlementItem : itemList){
erpSettlementVO.setSupplierId(settlementItem.getSupplierId() );
erpSettlementVO.setPurchaseContractId( settlementItem.getPurchaseContractId() );
erpSettlementVO.setDistributContractId( settlementItem.getDistributContractId());
//数量
//金额
//税额
//价税合计
}
}
erpSettlementVO.setItemList( itemList );
SupplierManage supplierManage = supplierManageMapper.selectById(erpSettlementVO.getSupplierId());
if(supplierManage != null ){
erpSettlementVO.setSupplierName( supplierManage.getSuppName() );
}
return erpSettlementVO;
// 根据入库单ids,获取【供应商】结算单详情
public List<ErpSettlementItem> querySupplierSettlementByMaterialIds(String materialInIds){
return this.baseMapper.querySupplierSettlementByMaterialIds( materialInIds );
}
//水厂结束清单
public ErpSettlementVO waterDepartSettlementByMaterialIds(String materialIds){
List<ErpSettlementItem> itemList = this.baseMapper.querySettlementByMaterialIds( materialIds );
ErpSettlementVO erpSettlementVO = new ErpSettlementVO();
if(itemList != null){
for(ErpSettlementItem settlementItem : itemList){
erpSettlementVO.setSupplierId(settlementItem.getSupplierId() );
}
}
erpSettlementVO.setItemList( itemList );
SysDepart depart = departMapper.selectById(erpSettlementVO.getDepartId());
if(depart != null ){
erpSettlementVO.setDepartName( depart.getDepartName() );
}
return erpSettlementVO;
// 根据入库单ids,获取【水厂】结算单详情
public List<ErpSettlementItem> queryWaterDepartSettlementByMaterialIds( String materialInIds){
return this.baseMapper.queryWaterDepartSettlementByMaterialIds( materialInIds );
}
}
......
package com.skua.modules.erp.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* 药剂结算单详情
*/
@Data
@ApiModel(value="erp_settlement数据传输对象", description="药剂结算单详情")
public class ErpSettlementFormVO {
@ApiModelProperty(value = "项目名称")
private String projectName;
@ApiModelProperty(value = "集团名称")
private String jtDepartName;
@ApiModelProperty(value = "供应商名称")
private String supplierName;
@ApiModelProperty(value = "部门名称")
private String departName;
@ApiModelProperty(value = "开始时间")
private String startTime;
@ApiModelProperty(value = "结束时间")
private String endTime;
/**合同编号*/
@ApiModelProperty(value = "合同编号")
private String contractCode;
@ApiModelProperty(value = "物料类别编号")
private String sparepartTypeName;
@ApiModelProperty(value = "物料名称")
private String sparepartName;
@ApiModelProperty(value = "规格型号")
private String specification;
@TableField(exist=false)
@ApiModelProperty(value = "结算清单")
private List<ErpSettlementItemVO> itemList ;
}
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.skua.modules.erp.entity.ErpSettlementItem;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -20,77 +21,20 @@ import org.jeecgframework.poi.excel.annotation.Excel;
*/
@Data
@ApiModel(value="erp_settlement_item数据传输对象", description="药剂结算单详情")
public class ErpSettlementItemVO {
/**主键*/
@ApiModelProperty(value = "主键")
private String id;
/**结算单编号*/
@Excel(name = "结算单编号", width = 15)
@ApiModelProperty(value = "结算单编号")
private String settlementId;
/**采购合同编号*/
@Excel(name = "采购合同编号", width = 15)
@ApiModelProperty(value = "采购合同编号")
private String contractId;
/**物料类别编号*/
@Excel(name = "物料类别编号", width = 15)
@ApiModelProperty(value = "物料类别编号")
private String sparepartType;
/**物料编号*/
@Excel(name = "物料编号", width = 15)
@ApiModelProperty(value = "物料编号")
private String sparepartId;
/**物料名称*/
@Excel(name = "物料名称", width = 15)
@ApiModelProperty(value = "物料名称")
private String sparepartName;
/**物料编码*/
@Excel(name = "物料编码", width = 15)
@ApiModelProperty(value = "物料编码")
private String sparepartCode;
/**货号*/
@Excel(name = "货号", width = 15)
@ApiModelProperty(value = "货号")
private String goodCode;
/**规格型号*/
@Excel(name = "规格型号", width = 15)
@ApiModelProperty(value = "规格型号")
private String specification;
/**计量单位*/
@Excel(name = "计量单位", width = 15)
@ApiModelProperty(value = "计量单位")
private String measuringUnit;
/**数量*/
@Excel(name = "数量", width = 15)
@ApiModelProperty(value = "数量")
private String materialNum;
/**单价*/
@Excel(name = "单价", width = 15)
@ApiModelProperty(value = "单价")
private String unitPrice;
/**总价*/
@Excel(name = "总价", width = 15)
@ApiModelProperty(value = "总价")
private String totalPrice;
/**税额*/
@Excel(name = "税额", width = 15)
@ApiModelProperty(value = "税额")
private String taxAmount;
/**价税合计*/
@Excel(name = "价税合计", width = 15)
@ApiModelProperty(value = "价税合计")
private String totalPriceTax;
/**到货时间*/
@Excel(name = "到货时间", width = 15)
@ApiModelProperty(value = "到货时间")
private String arriveTime;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private String remark;
/**删除标识,0:有效,1:删除*/
@Excel(name = "删除标识,0:有效,1:删除", width = 15)
@ApiModelProperty(value = "删除标识,0:有效,1:删除")
private Integer delFlag;
public class ErpSettlementItemVO extends ErpSettlementItem {
/**外观情况*/
@ApiModelProperty(value = "外观情况")
private String appearanceInfo;
/**货物与合同清单匹配情况*/
@ApiModelProperty(value = "货物与合同清单匹配情况")
private String matchedInfo;
/**处理意见*/
@ApiModelProperty(value = "处理意见")
private String handleMsg;
/**送货/供方人员签字*/
@ApiModelProperty(value = "送货/供方人员签字")
private String senderSign;
/**收货人员签字*/
@ApiModelProperty(value = "收货人员签字")
private String receiverSign;
}
......
......@@ -25,6 +25,9 @@ import org.jeecgframework.poi.excel.annotation.Excel;
@Data
@ApiModel(value="erp_settlement数据传输对象", description="药剂结算单详情")
public class ErpSettlementVO extends ErpSettlement {
@TableField(exist=false)
@ApiModelProperty(value = "项目名称")
private String projectName;
@TableField(exist=false)
@ApiModelProperty(value = "供应商名称")
......
......@@ -9,6 +9,7 @@ import com.skua.modules.custom.vo.FCustomReportDatasetVO;
import com.skua.modules.report.vo.DataVO;
import com.skua.modules.report.vo.JnhbLargeScreenVO;
import com.skua.modules.report.vo.JnhbReportData;
import com.skua.modules.report.vo.largeScreen.ResultNumberVO;
/**
* 数据集管理
......@@ -112,10 +113,20 @@ public interface IFCustomReportDatasetService extends IService<FCustomReportData
* @return
*/
JnhbLargeScreenVO jnhbLargeScreenShow(String departIds,String time);
/**
* 节能环保 大屏展示:ESG减排趋势:吨消减耗能:排放指标
* @return
*/
JnhbLargeScreenVO jnhbLargeScreenShowESG(String departIds, String time);
/**
* 节能环保:大屏展示:头部数据
* @return
*/
JnhbLargeScreenVO jnhbLargeScreenShowHeader(String departIds,String time);
List<ResultNumberVO> jnhbLargeScreenShowHeader(String departIds,String time);
/**
* 节能环保:大屏展示:消减量
* @return
*/
List<ResultNumberVO> jnhbLargeScreenShowResultNumber(String departIds, String time);
}
......
package com.skua.modules.report.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.google.common.collect.Maps;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.api.vo.Result;
......@@ -10,9 +9,9 @@ import com.skua.core.util.ConvertUtils;
import com.skua.core.util.DateUtils;
import com.skua.modules.custom.service.IFCustomReportDatasetService;
import com.skua.modules.report.service.IReportDataService;
import com.skua.modules.report.vo.DataVO;
import com.skua.modules.report.vo.JnhbLargeScreenVO;
import com.skua.modules.report.vo.JnhbReportData;
import com.skua.modules.report.vo.largeScreen.ResultNumberVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
......@@ -202,13 +201,35 @@ public class ReportDataController {
}
@AutoLog(value = "节能环保:大屏展示")
@ApiOperation(value = "节能环保:大屏展示:头部数据", notes = "节能环保:大屏展示(time:yyyy-MM)")
@GetMapping(value = "/jnhbLargeScreenShow_header")
public Result<JnhbLargeScreenVO> jnhbLargeScreenShowHeader( @RequestParam(name="time") String time) { //time
@ApiOperation(value = "节能环保:大屏展示:ESG减排趋势:吨消减耗能:排放指标", notes = "节能环保:大屏展示:ESG减排趋势:吨消减耗能:排放指标(time:yyyy-MM)")
@GetMapping(value = "/jnhbLargeScreenShowESG")
public Result<JnhbLargeScreenVO> jnhbLargeScreenShowESG( @RequestParam(name="time") String time) { //time
Result<JnhbLargeScreenVO> result = new Result<>();
String departIds = BaseContextHandler.getDeparts();
JnhbLargeScreenVO jnhbLargeScreenVO = fCustomReportDatasetService.jnhbLargeScreenShow(departIds,time);
JnhbLargeScreenVO jnhbLargeScreenVO = fCustomReportDatasetService.jnhbLargeScreenShowESG(departIds,time);
result.setResult(jnhbLargeScreenVO);
return result;
}
@AutoLog(value = "节能环保:大屏展示")
@ApiOperation(value = "节能环保:大屏展示:头部数据", notes = "节能环保:大屏展示(time:yyyy-MM)")
@GetMapping(value = "/jnhbLargeScreenShow_header")
public Result<List<ResultNumberVO>> jnhbLargeScreenShowHeader( @RequestParam(name="time") String time) { //time
Result<List<ResultNumberVO>> result = new Result<>();
String departIds = BaseContextHandler.getDeparts();
List<ResultNumberVO> dataList = fCustomReportDatasetService.jnhbLargeScreenShowHeader(departIds,time);
result.setResult(dataList);
return result;
}
@AutoLog(value = "节能环保:大屏展示")
@ApiOperation(value = "节能环保:大屏展示:消减量", notes = "节能环保:大屏展示:消减量(time:yyyy-MM)")
@GetMapping(value = "/jnhbLargeScreenShowResultNumber")
public Result<List<ResultNumberVO>> jnhbLargeScreenShowResultNumber( @RequestParam(name="time") String time) { //time
Result<List<ResultNumberVO>> result = new Result<>();
String departIds = BaseContextHandler.getDeparts();
List<ResultNumberVO> dataLIst = fCustomReportDatasetService.jnhbLargeScreenShowResultNumber(departIds,time);
result.setResult(dataLIst);
return result;
}
}
......
package com.skua.modules.report.vo;
import cn.hutool.core.convert.Convert;
import com.skua.core.util.ConvertUtils;
import com.skua.modules.flow.utils.ConvertUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
/**
* @auther kangwei
* @create 2024-10-21-9:17
*/
@Data
public class JnhbLargeScreenExpressionVO {
//头部-数据统计:污水处理量、系统负荷率、电耗、汽油、薪水、综合能耗、C02,
private String head_wssjcll_expression ="0";//污水处理量
private String head_wsfhl_expression="0";//系统负荷率
private String head_dh_expression="0";//电耗
private String head_qy_expression="0"; //汽油
private String head_xssyl_expression="0";//薪水
private String head_zhnyxhl_expression="0";//综合能耗
private String head_eyhtpfl_expression="0";//C02
private String head_dsdh_expression = "0";//吨水电耗
private String head_wssjcll_expression_hb ="0";//污水处理量
private String head_wsfhl_expression_hb ="0";//系统负荷率
private String head_dh_expression_hb ="0";//电耗
private String head_qy_expression_hb ="0"; //汽油
private String head_xssyl_expression_hb ="0";//薪水
private String head_zhnyxhl_expression_hb ="0";//综合能耗
private String head_eyhtpfl_expression_hb="0";//C02
private String head_dsdh_expression_hb = "0";//吨水电耗
private String head_wssjcll_expression_tb ="0";//污水处理量
private String head_wsfhl_expression_tb="0";//系统负荷率
private String head_dh_expression_tb ="0";//电耗
private String head_qy_expression_tb ="0"; //汽油
private String head_xssyl_expression_tb ="0";//薪水
private String head_zhnyxhl_expression_tb ="0";//综合能耗
private String head_eyhtpfl_expression_tb ="0";//C02
private String head_dsdh_expression_tb = "0";//吨水电耗
/***
* 消减量统计
* @param reportData
*/
private String reduce_statistics_cod = "0";//消减量统计
private String reduce_statistics_nh3n = "0";//消减量统计
private String reduce_statistics_tp = "0";//消减量统计
private String reduce_statistics_tn = "0";//消减量统计
private String reduce_statistics_cod_hb = "0";//消减量统计
private String reduce_statistics_nh3n_hb = "0";//消减量统计
private String reduce_statistics_tp_hb = "0";//消减量统计
private String reduce_statistics_tn_hb = "0";//消减量统计
private String reduce_statistics_cod_tb = "0";//消减量统计
private String reduce_statistics_nh3n_tb = "0";//消减量统计
private String reduce_statistics_tp_tb = "0";//消减量统计
private String reduce_statistics_tn_tb = "0";//消减量统计
public void setReduceStatistics(JnhbReportData reportData){
if(StringUtils.isNotEmpty( reportData.getCodxjl() )) reduce_statistics_cod = ConvertUtils.getString(reportData.getCodxjl() ,"0") +" + " + reduce_statistics_cod;//污水处理量 ;
if(StringUtils.isNotEmpty( reportData.getTnxjl() )) reduce_statistics_nh3n = ConvertUtils.getString(reportData.getTnxjl() ,"0") +" + " + reduce_statistics_nh3n;//系统负荷率 ;
if(StringUtils.isNotEmpty( reportData.getTpxjl() )) reduce_statistics_tp = ConvertUtils.getString(reportData.getTpxjl() ,"0") +" + " + reduce_statistics_tp;//电耗 ;
if(StringUtils.isNotEmpty( reportData.getTnxjl() )) reduce_statistics_tn = ConvertUtils.getString(reportData.getTnxjl() ,"0") +" + " + reduce_statistics_tn;//汽油 ;
}
public void setReduceStatisticsHB(JnhbReportData reportData){
if(StringUtils.isNotEmpty( reportData.getCodxjl() )) reduce_statistics_cod_hb = ConvertUtils.getString(reportData.getCodxjl() ,"0") +" + " + reduce_statistics_cod_hb;//污水处理量 ;
if(StringUtils.isNotEmpty( reportData.getTnxjl() )) reduce_statistics_nh3n_hb = ConvertUtils.getString(reportData.getTnxjl() ,"0") +" + " + reduce_statistics_nh3n_hb;//系统负荷率 ;
if(StringUtils.isNotEmpty( reportData.getTpxjl() )) reduce_statistics_tp_hb = ConvertUtils.getString(reportData.getTpxjl() ,"0") +" + " + reduce_statistics_tp_hb;//电耗 ;
if(StringUtils.isNotEmpty( reportData.getTnxjl() )) reduce_statistics_tn_hb = ConvertUtils.getString(reportData.getTnxjl() ,"0") +" + " + reduce_statistics_tn_hb;//汽油 ;
}
public void setReduceStatisticsTB(JnhbReportData reportData){
if(StringUtils.isNotEmpty( reportData.getCodxjl() )) reduce_statistics_cod_tb = ConvertUtils.getString(reportData.getCodxjl() ,"0") +" + " + reduce_statistics_cod_tb;//污水处理量 ;
if(StringUtils.isNotEmpty( reportData.getTnxjl() )) reduce_statistics_nh3n_tb = ConvertUtils.getString(reportData.getTnxjl() ,"0") +" + " + reduce_statistics_nh3n_tb;//系统负荷率 ;
if(StringUtils.isNotEmpty( reportData.getTpxjl() )) reduce_statistics_tp_tb = ConvertUtils.getString(reportData.getTpxjl() ,"0") +" + " + reduce_statistics_tp_tb;//电耗 ;
if(StringUtils.isNotEmpty( reportData.getTnxjl() )) reduce_statistics_tn_tb = ConvertUtils.getString(reportData.getTnxjl() ,"0") +" + " + reduce_statistics_tn_tb;//汽油 ;
}
}
......@@ -17,42 +17,31 @@ import java.util.List;
@ApiModel(value="生产运营--大屏对象", description="生产运营--月度生产数据报表")
public class JnhbLargeScreenVO {
@ApiModelProperty(value = "头部统计数值")
private List<ResultNumberVO> headStatisticsList = new ArrayList<>();
private List<ResultNumberVO> headStatisticsList = null;
@ApiModelProperty(value = "各站点能源消耗排名")
private List<PowerConsumeVO> powerConsumeVOList = new ArrayList();
private List<PowerConsumeVO> powerConsumeVOList = null;
@ApiModelProperty(value = "负荷率对象")
private List<LoadRateVO> loadRateVOList = new ArrayList<>();
private List<LoadRateVO> loadRateVOList = null;
@ApiModelProperty(value = "CO2排放排名")
private List<ResultNumberVO> co2DataList = new ArrayList<>();
private List<ResultNumberVO> co2DataList = null;
@ApiModelProperty(value = "消减量统计")
private List<ResultNumberVO> reduceStatisticsList = new ArrayList<>(4);
private List<ResultNumberVO> reduceStatisticsList = null;
@ApiModelProperty(value = "ESG减排趋势")
private List<ResultChartsVO> esgChartsList= new ArrayList<>();
private List<ResultChartsVO> esgChartsList= null;
@ApiModelProperty(value = "吨消减能耗")
private List<ResultChartsVO> energyConsumeChartsList= new ArrayList<>();
private List<ResultChartsVO> energyConsumeChartsList = null;
@ApiModelProperty(value = "废物处理对象集合")
private List<WasteMaterialVO> wasteMaterialList = new ArrayList<>();//废物处理对象集合
private List<WasteMaterialVO> wasteMaterialList = null;//废物处理对象集合
@ApiModelProperty(value = "一级能耗设备数量")
private Integer equipmentL1;
@ApiModelProperty(value = "二级能耗设备")
private Integer equipmentL2;
/***
* 设置:消减统计记录
*/
public void setReduceStatistics(JnhbLargeScreenExpressionVO largeScreenExpressionVO){
this.getReduceStatisticsList().add( new ResultNumberVO( "cod","",JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_cod(),"0") , JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_cod_hb() ,"0") , JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_cod_tb(),"0")) );//吨水电耗
this.getReduceStatisticsList().add( new ResultNumberVO( "NH3-N","",JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_nh3n() ,"0") , JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_nh3n_hb() ,"0") , JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_nh3n_tb(),"0")) );//吨水电耗
this.getReduceStatisticsList().add( new ResultNumberVO( "TP","",JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_tp() ,"0") , JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_tp_hb() ,"0") , JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_tp_tb(),"0")) );//吨水电耗
this.getReduceStatisticsList().add( new ResultNumberVO( "TN","",JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_tn() ,"0") , JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_tn_hb() ,"0") , JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_tn_tb(),"0")) );//吨水电耗
}
}
......
......@@ -18,7 +18,7 @@ public interface IEquipmentSparepartTypeService extends IService<EquipmentSparep
* @param sparepartTypeId
* @return
*/
public Set<String> getAllChildrenSparepartTypeIds( String sparepartTypeId );
Set<String> getAllChildrenSparepartTypeIds( String sparepartTypeId );
/**
* <pre>
* 保存并修改父级叶子节点状态
......
......@@ -7,7 +7,6 @@ import com.skua.modules.system.model.DepartIdModel;
import com.skua.modules.system.model.SysDepartTreeModel;
import com.skua.modules.system.vo.DepartTree;
import com.skua.modules.system.vo.SysDeptUserVO;
import java.util.List;
import java.util.Map;
import java.util.Set;
......@@ -23,7 +22,7 @@ public interface ISysDepartService extends IService<SysDepart>{
* @param departId
* @return
*/
public Set<String> getAllChildrenDepartIds(String departId);
Set<String> getAllChildrenDepartIds(String departId);
/**
* 查询所有部门信息,并分节点进行显示
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!