f0644138 张雷

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

2 个父辈 8e85de86 705927e8
正在显示 36 个修改的文件 包含 541 行增加300 行删除
......@@ -81,9 +81,9 @@ public class ReportViewUtil {
if(!StringUtils.isEmpty(itemIds)) {
itemIds = itemIds.substring(1);
}
sb.append(" `a`.`depart_id` AS `depart_id`,`a`.`data_id` AS `id`,`a`.`data_time` AS `time` from (( ");
sb.append(" `a`.`create_time` , `a`.`depart_id` AS `depart_id`,`a`.`data_id` AS `id`,`a`.`data_time` AS `time` from (( ");
sb.append(" SELECT data_id,reit_id,item_value,data_time,depart_id FROM f_report_itemv v WHERE 1=1 ");
sb.append(" SELECT data_id,reit_id,item_value,data_time,depart_id,create_time FROM f_report_itemv v WHERE 1=1 ");
if(StringUtils.isNotEmpty(departIds)){
sb.append(" and depart_id in ("+inSqlPart+") ");
}
......
......@@ -19,7 +19,7 @@ import org.springframework.format.annotation.DateTimeFormat;
* 危险作业事件
*/
@Data
@TableName("dangerous_operation_manage")
@TableName("dangerous_operation_manage")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="dangerous_operation_manage对象", description="危险作业事件")
......
......@@ -84,8 +84,7 @@ public class DistributContractController {
@AutoLog(value = "erp分销合同-列表查询")
@ApiOperation(value="erp分销合同-列表查询", notes="erp分销合同-列表查询")
@GetMapping(value = "/disContractList")
public Result<List<DistributContract>> queryPageList(DistributContract distributContract,
HttpServletRequest req) {
public Result<List<DistributContract>> queryPageList(DistributContract distributContract,HttpServletRequest req) {
Result<List<DistributContract>> result = new Result<List<DistributContract>>();
QueryWrapper<DistributContract> queryWrapper = QueryGenerator.initQueryWrapper(distributContract, req.getParameterMap());
// 需要添加条件判断
......
......@@ -208,10 +208,10 @@ public class MaterialINController {
@AutoLog(value = "erp--物料(药剂)入库-添加")
@ApiOperation(value="erp--物料(药剂)入库-添加", notes="erp--物料(药剂)入库-添加")
@PostMapping(value = "/add")
public Result<MaterialIN> add(@RequestBody MaterialIN materialIN) {
Result<MaterialIN> result = new Result<MaterialIN>();
public Result<MaterialINVO> add(@RequestBody MaterialINVO materialINVO) {
Result<MaterialINVO> result = new Result<MaterialINVO>();
try {
materialINService.saveMaterialIN(materialIN);
materialINService.saveMaterialIN(materialINVO);
result.success("添加成功!");
} catch (Exception e) {
log.error(e.getMessage(),e);
......@@ -223,13 +223,16 @@ public class MaterialINController {
@AutoLog(value = "erp--物料(药剂)入库-编辑")
@ApiOperation(value="erp--物料(药剂)入库-编辑", notes="erp--物料(药剂)入库-编辑")
@PutMapping(value = "/edit")
public Result<MaterialIN> edit(@RequestBody MaterialIN materialIN) {
Result<MaterialIN> result = new Result<MaterialIN>();
MaterialIN materialINEntity = materialINService.getById(materialIN.getId());
public Result<MaterialINVO> edit(@RequestBody MaterialINVO materialINVO) {
Result<MaterialINVO> result = new Result<MaterialINVO>();
/*if(StringUtils.isNotEmpty(materialIN.getDistributTotalPrice()) && !materialIN.getDistributTotalPrice().equals(materialIN.getTotalPrice()) ){
materialIN.setTotalPrice( materialIN.getDistributTotalPrice());
}*/
MaterialIN materialINEntity = materialINService.getById(materialINVO.getId());
if(materialINEntity==null) {
result.error500("未找到对应实体");
}else {
materialINService.updateMaterialIN(materialIN);
materialINService.updateMaterialIN(materialINVO);
result.success("修改成功!");
}
return result;
......@@ -241,6 +244,7 @@ public class MaterialINController {
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
try {
materialINService.removeById(id);
materialAcceptanceFormService.removeById(id);
} catch (Exception e) {
log.error("删除失败",e.getMessage());
return Result.error("删除失败!");
......@@ -265,21 +269,21 @@ public class MaterialINController {
@AutoLog(value = "erp--物料(药剂)入库-通过id查询")
@ApiOperation(value="erp--物料(药剂)入库-通过id查询", notes="erp--物料(药剂)入库-通过id查询")
@GetMapping(value = "/queryById")
public Result<MaterialIN> queryById(@RequestParam(name="id",required=true) String id) {
Result<MaterialIN> result = new Result<MaterialIN>();
MaterialIN materialIN = materialINService.queryById(id);
public Result<MaterialINVO> queryById(@RequestParam(name="id",required=true) String id) {
Result<MaterialINVO> result = new Result<MaterialINVO>();
MaterialINVO materialIN = materialINService.queryById(id);
/**/
if(materialIN==null) {
result.error500("未找到对应实体");
}else {
result.setResult(materialIN);
result.setSuccess(true);
}
return result;
}
@AutoLog(value = "erp--药剂入库-送审")
@ApiOperation(value="erp--药剂入库-送审", notes="erp--药剂入库-送审")
@GetMapping(value = "/sendAudit")
......@@ -299,7 +303,7 @@ public class MaterialINController {
} catch (Exception e) {
log.error("送审失败",e.getMessage());
result.setResult(materialIN);
result.setSuccess(true);
result.error500(e.getMessage());
}
return result;
}
......
......@@ -10,10 +10,8 @@ import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.query.QueryGenerator;
import com.skua.core.util.DateUtils;
import com.skua.modules.erp.entity.DistributContractTemp;
import com.skua.modules.erp.entity.ERPPurchaseContract;
import com.skua.modules.erp.entity.PurchaseContractTemp;
import com.skua.modules.erp.entity.PurchaseMaterial;
import com.skua.modules.erp.service.IERPPurchaseContractService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......
......@@ -43,18 +43,11 @@ public class DistributMaterial {
@ApiModelProperty(value = "物料编号")
private String sparepartId;
/**物料名称*/
@Excel(name = "物料名称", width = 15)
@ApiModelProperty(value = "物料名称")
private String sparepartName;
/**货号*/
@Excel(name = "货号", width = 15)
@ApiModelProperty(value = "货号")
private String goodCode;
/**计量单位*/
@Excel(name = "计量单位", width = 15)
@ApiModelProperty(value = "计量单位")
private String measuringUnit;
/**物料数量*/
@Excel(name = "物料数量", width = 15)
@ApiModelProperty(value = "物料数量")
......
......@@ -43,34 +43,15 @@ public class ErpSettlementItem {
@ApiModelProperty(value = "物料编号")
@Dict(dictTable = "equipment_sparepart_supplies", dicCode="id", dicText = "sparepart_name")
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 = "总价")
......@@ -103,7 +84,4 @@ public class ErpSettlementItem {
@ApiModelProperty(value = "分销合同")
private String distributContractId;
}
......
......@@ -30,10 +30,24 @@ public class MaterialAcceptanceForm {
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "入库单号")
private String id;
/**所属机构*/
@Excel(name = "所属机构", width = 15)
@ApiModelProperty(value = "所属机构")
@Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
private String departId;
@ApiModelProperty(value = "货号")
private String goodCode;
@Excel(name = "分销合同Code", width = 15)
private String distributContractCode;
@Excel(name = "采购合同Code", width = 15)
private String purchaseContractCode;
/**入库单号*/
@Excel(name = "入库单号", width = 15)
@ApiModelProperty(value = "入库单号")
private String inOrder;
@ApiModelProperty(value = "技术文件/资料")
private String jishuFilePath;
/**外观情况*/
......
package com.skua.modules.erp.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
......@@ -8,7 +7,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.skua.core.aspect.annotation.Dict;
import com.skua.tool.util.JSUtils;
import io.netty.util.internal.StringUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -49,10 +47,21 @@ public class MaterialIN {
@Excel(name = "采购合同", width = 15,dictTable = "erp_purchase_contract", dicCode="id", dicText = "contract_code")
@Dict(dictTable = "erp_purchase_contract", dicCode="id", dicText = "contract_code")
private String purchaseContractId;
@Excel(name = "采购合同Code", width = 15)
private String purchaseContractCode;
/**分销合同*/
@Excel(name = "分销合同", width = 15,dictTable = "erp_distribut_contract", dicCode="id", dicText = "contract_code")
@Dict(dictTable = "erp_distribut_contract", dicCode="id", dicText = "contract_code")
@ApiModelProperty(value = "分销合同")
private String distributContractId;
@Excel(name = "分销合同Code", width = 15)
@ApiModelProperty(value = "分销合同Code")
private String distributContractCode;
@Excel(name = "分销物料编号", width = 15)
@ApiModelProperty(value = "分销物料编号")
private String distributMaterialId;
/**到货时间*/
@Excel(name = "到货时间", width = 15)
@ApiModelProperty(value = "到货时间")
......@@ -72,21 +81,7 @@ public class MaterialIN {
@ApiModelProperty(value = "物料编号")
@Dict(dictTable = "equipment_sparepart_supplies", dicCode="id", dicText = "sparepart_name")
private String sparepartId;
/**药剂(物料)名称*/
@Excel(name = "药剂(物料)名称", width = 15)
@ApiModelProperty(value = "药剂(物料)名称")
private String sparepartName;
@ApiModelProperty(value = "物料编码")
private String sparepartCode;
/**规格型号*/
@Excel(name = "规格型号", width = 15)
@ApiModelProperty(value = "规格型号")
private String specification;
/**计量单位*/
@Excel(name = "计量单位", width = 15)
@ApiModelProperty(value = "计量单位")
private String measuringUnit;
@Excel(name = "入库仓库", width = 15,dictTable = "supplies_warehouse", dicCode="id", dicText = "warehouse_name")
@ApiModelProperty(value = "入库仓库")
......@@ -102,21 +97,17 @@ public class MaterialIN {
@Excel(name = "货号", width = 15)
@ApiModelProperty(value = "货号")
private String goodCode;
/**采购单价*/
@ApiModelProperty(value = "采购单价")
private String purchasePrice;
/**分销单价*/
@ApiModelProperty(value = "分销单价")
private String distributPrice;
@Excel(name = "物料数量", width = 15)
@ApiModelProperty(value = "物料数量")
private String materialNum;
/**税额*/
@ApiModelProperty(value = "税额")
private String taxAmount;
@ApiModelProperty(value = "分销总价")
private String distributTotalPrice;
@ApiModelProperty(value = "总价")
private String totalPrice;
/**分享地址*/
@ApiModelProperty(value = "分享地址")
private String shareUrl;
......@@ -137,7 +128,6 @@ public class MaterialIN {
@ApiModelProperty(value = "申请人")
private String applyUser;
/**入库类型*/
@ApiModelProperty(value = "入库类型")
private String inType;
......@@ -199,50 +189,4 @@ public class MaterialIN {
@ApiModelProperty(value = "结束时间")
private String endTime;
@TableField(exist = false)
@ApiModelProperty(value = "物料类别")
private String sparepartTypeName;
@TableField(exist = false)
@ApiModelProperty(value = "供应商名称")
private String supplierName;
@TableField(exist = false)
private String departName;
/**采购总价*/
@TableField(exist = false)
@ApiModelProperty(value = "采购总价")
private String purchaseTotalPrice;
/**价税合计*/
@TableField(exist = false)
@ApiModelProperty(value = "总价(不含税)")
private String totalPriceTax;
/**分销总价*/
@TableField(exist = false)
@ApiModelProperty(value = "分销总价")
private String distributTotalPrice;
public String getPurchaseTotalPrice() {
if(StringUtils.isNotEmpty(this.getPurchasePrice()) && StringUtils.isNotEmpty(this.getMaterialNum())){
purchaseTotalPrice = JSUtils.multiply(purchasePrice ,materialNum ) ;
}
return purchaseTotalPrice;
}
public String getDistributTotalPrice() {
if( StringUtils.isNotEmpty(this.getDistributPrice()) && StringUtils.isNotEmpty(this.getMaterialNum())){
distributTotalPrice = JSUtils.multiply(distributPrice ,materialNum ) ;
}
return distributTotalPrice;
}
public String getTotalPriceTax() {
//不含税总价 = 含税总价 / (1 + 税率)
if(StringUtils.isNotEmpty(this.getTaxAmount()) && StringUtils.isNotEmpty(this.getDistributPrice()) && StringUtils.isNotEmpty(this.getMaterialNum())){
String expression = distributPrice +" * " +materialNum +"/( 1 +"+taxAmount+"* 0.01)";
totalPriceTax = JSUtils.executeExpression(expression ,"0.00" ) ;
}
return totalPriceTax;
}
}
......
package com.skua.modules.erp.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
......@@ -13,7 +11,6 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* 采购物料清单
*/
......@@ -43,29 +40,12 @@ public class PurchaseMaterial {
@Excel(name = "物料编号", width = 15)
@ApiModelProperty(value = "物料编号")
private String sparepartId;
@ApiModelProperty(value = "物料编码")
private String sparepartCode;
@ApiModelProperty(value = "物料名称")
private String sparepartName;
/**物料编号*/
@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;
@ApiModelProperty(value = "产地")
private String goodOrigin;
@ApiModelProperty(value = "品牌")
private String goodBrand;
/**计划采购数量*/
@Excel(name = "计划采购数量", width = 15)
@ApiModelProperty(value = "计划采购数量")
......@@ -83,6 +63,13 @@ public class PurchaseMaterial {
@ApiModelProperty(value = "备注")
private String remark;
@Excel(name = "品牌", width = 15)
@ApiModelProperty(value = "品牌")
private String goodOrigin;
@Excel(name = "产地", width = 15)
@ApiModelProperty(value = "产地")
private String goodBrand;
/**供应商编号*/
@Excel(name = "供应商编号", width = 15)
......@@ -99,32 +86,6 @@ public class PurchaseMaterial {
private String totalPriceTax;
@TableField(exist=false)
@ApiModelProperty(value = "物料类别名称")
private String sparepartTypeName;
@TableField(exist=false)
@ApiModelProperty(value = "供应商名称")
private String supplierName;
@TableField(exist=false)
@ApiModelProperty(value = "厂站名称")
private String departName;
@TableField(exist=false)
@ApiModelProperty(value = "扩展:采购物料数量")
private String materialNum;
/**单价*/
@TableField(exist=false)
@Excel(name = "分销单价", width = 15)
@ApiModelProperty(value = "扩展:分销单价")
private String distributPrice;
/**总价*/
@TableField(exist=false)
@Excel(name = "分销总价", width = 15)
@ApiModelProperty(value = "扩展:分销总价")
private String distributTotalPrice;
@TableField(exist=false)
@ApiModelProperty(value = "扩展:货号物料入库数量")
private String storeNum;
......@@ -132,9 +93,6 @@ public class PurchaseMaterial {
@ApiModelProperty(value = "扩展:剩余数量")
private Double remainNum;
@TableField(exist=false)
@ApiModelProperty(value = "采购合同编号")
private String purchaseContractId;
public String getPurchaseContractId() {
return this.getContractId();
......
......@@ -2,6 +2,7 @@ package com.skua.modules.erp.mapper;
import java.util.List;
import com.skua.modules.erp.vo.DistributMaterialVO;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.erp.entity.DistributMaterial;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -13,7 +14,7 @@ public interface DistributMaterialMapper extends BaseMapper<DistributMaterial> {
public void delByContractId( @Param("contractId") String contractId);
List<DistributMaterial> queryListByContractId( @Param("contractId") String contractId);
List<DistributMaterialVO> queryListByContractId(@Param("contractId") String contractId);
/***
* 根据id或code校验货号是否唯一
......
......@@ -4,6 +4,7 @@ import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.skua.modules.erp.vo.ArrivalRecordExcelExportVO;
import com.skua.modules.erp.vo.MaterialINVO;
import com.skua.tool.annotation.Anonymous;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.erp.entity.MaterialIN;
......@@ -30,7 +31,7 @@ public interface MaterialINMapper extends BaseMapper<MaterialIN> {
List<MaterialIN> selectAuditMaterialINByPage(IPage<MaterialIN> page, @Param("materialIN") MaterialIN materialIN);
@Anonymous
public MaterialIN queryById(@Param("id") String id);
MaterialINVO queryById(@Param("id") String id);
/**
* 批量送审
......
......@@ -30,7 +30,7 @@ public interface PurchaseMaterialMapper extends BaseMapper<PurchaseMaterial> {
* @param contractId
* @return
*/
List<PurchaseMaterial> queryListByContractId( @Param("contractId") String contractId);
List<PurchaseMaterialVO> queryListByContractId( @Param("contractId") String contractId);
/***
......@@ -45,7 +45,7 @@ public interface PurchaseMaterialMapper extends BaseMapper<PurchaseMaterial> {
/***
* 根据货号查询采购合同物料清单
* @param goodCode
* @param departIds
* @param departId
* @return
*/
List<PurchaseMaterial> queryMaterialByGoodCode( @Param("goodCode")String goodCode, @Param("departIds")String departId);
......
......@@ -9,9 +9,13 @@
</delete>
<!-- 根据计划编号获取采购清单列表 -->
<select id="queryListByContractId" resultType="com.skua.modules.erp.entity.DistributMaterial">
select m.* from erp_distribut_material m
where m.contract_id = #{contractId}
<select id="queryListByContractId" resultType="com.skua.modules.erp.vo.DistributMaterialVO">
select m.* ,st.item_text as 'sparepart_type_name', ss.sparepart_name, ss.sparepart_code,ss.specification,ss.measuring_unit
from erp_distribut_material m
left join equipment_sparepart_supplies ss on m.sparepart_id = ss.id
left join equipment_sparepart_type st on st.id = ss.sparepart_type
where m.contract_id = #{contractId}
</select>
......
......@@ -7,10 +7,15 @@
</delete>
<!-- 结算单详情:供应商-->
<select id="queryListBySupplier" resultType="com.skua.modules.erp.vo.ErpSettlementItemVO">
select d.depart_name, sm.supp_name supplierName,pc.project_name, pc.contract_name,pc.contract_code, mf.jishu_file_path, mf.appearance_info, mf.matched_info ,mf.handle_msg,mf.sender_sign,mf.receiver_sign, pm.good_brand , pm.good_origin, si.*
select d.depart_name, sm.supp_name supplierName,pc.project_name, pc.contract_name,pc.contract_code, mf.jishu_file_path, mf.appearance_info, mf.matched_info ,mf.handle_msg,mf.sender_sign,mf.receiver_sign,
pm.good_brand , pm.good_origin,pm.tax_amount,pm.unit_price,
ss.sparepart_code,ss.sparepart_name, ss.specification,ss.measuring_unit,
si.id,si.settlement_id,si.depart_id,si.material_in_id,si.purchase_contract_id,si.distribut_contract_id,si.sparepart_id,si.material_num,si.arrive_time,
(pm.unit_price * si.material_num)'total_price',round(pm.unit_price * si.material_num *100 /(100+ ifnull(pm.tax_amount,0)) ,2) total_price_tax
from erp_settlement_item si
left join sys_depart d on d.id = si.depart_id
left join erp_purchase_material pm on (pm.contract_id =si.purchase_contract_id and pm.good_code = si.good_code )
left join equipment_sparepart_supplies ss on si.sparepart_id = ss.id
left join erp_material_acceptance_form mf on mf.id = si.material_in_id
left join erp_purchase_contract pc on si.purchase_contract_id = pc.id
left join ajh_supplier_manage sm on sm.id = pm.supplier_id
......@@ -18,12 +23,18 @@
</select>
<!-- 结算单详情:水厂-->
<select id="queryListByWaterDepart" resultType="com.skua.modules.erp.vo.ErpSettlementItemVO">
select d.depart_name, dc.contract_name ,dc.project_name,dc.contract_code, mf.jishu_file_path, mf.appearance_info, mf.matched_info ,mf.handle_msg,mf.sender_sign,mf.receiver_sign, pm.good_brand , pm.good_origin, si.*
select d.depart_name, dc.contract_name ,dc.project_name,dc.contract_code, mf.jishu_file_path, mf.appearance_info, mf.matched_info ,mf.handle_msg,mf.sender_sign,mf.receiver_sign,
dm.tax_amount,dm.distribut_price 'unit_price',
ss.sparepart_code,ss.sparepart_name, ss.specification,ss.measuring_unit,
si.id,si.settlement_id,si.depart_id,si.material_in_id,si.distribut_contract_id,si.purchase_contract_id,si.sparepart_id,si.material_num,si.arrive_time,
(dm.distribut_price * si.material_num)'total_price',round(dm.distribut_price * si.material_num *100 /(100+ ifnull(dm.tax_amount,0)) ,2) total_price_tax
from erp_settlement_item si
left join sys_depart d on d.id = si.depart_id
left join erp_purchase_material pm on (pm.contract_id =si.purchase_contract_id and pm.good_code = si.good_code )
left join erp_material_acceptance_form mf on mf.id = si.material_in_id
left join erp_distribut_contract dc on si.distribut_contract_id = dc.id
left join equipment_sparepart_supplies ss on si.sparepart_id = ss.id
left join erp_distribut_material dm on (dm.contract_id =si.distribut_contract_id and dm.good_code = si.good_code )
where si.settlement_id = #{settlementId}
</select>
</mapper>
......
......@@ -17,10 +17,11 @@
select sm.supp_name 'supplierName',d.depart_name, mi.depart_id, mf.jishu_file_path, mf.appearance_info, mf.matched_info ,mf.handle_msg,mf.sender_sign,mf.receiver_sign,
pc.contract_name,pc.contract_code,pc.project_name , mi.purchase_contract_id , pm.good_brand , pm.good_origin, pm.unit_price ,mi.material_num, pm.tax_amount ,round(pm.unit_price * mi.material_num,2) total_price,
round(pm.unit_price * mi.material_num *100 /(100+ ifnull(pm.tax_amount,0)) ,2) 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'
mi.arrive_time ,mi.remark,mi.id 'material_in_id',mi.good_code,mi.sparepart_id,ss.sparepart_code,ss.sparepart_name, ss.specification,ss.measuring_unit
from erp_material_in mi
left join erp_purchase_contract pc on mi.purchase_contract_id = pc.id
left join sys_depart d on d.id = mi.depart_id
left join equipment_sparepart_supplies ss on mi.sparepart_id = ss.id
left join erp_purchase_material pm on (pm.contract_id =mi.purchase_contract_id and pm.good_code = mi.good_code )
left join erp_material_acceptance_form mf on mf.id = mi.id
left join ajh_supplier_manage sm on pm.supplier_id = sm.id
......@@ -45,11 +46,12 @@
select d.depart_name,mi.depart_id, dc.contract_name ,dc.project_name, dc.contract_code, dm.distribut_price 'unit_price' , pm.good_brand , pm.good_origin, mf.jishu_file_path, mf.appearance_info, mf.matched_info ,mf.handle_msg,mf.sender_sign,mf.receiver_sign, dm.tax_amount ,
round(dm.distribut_price * mi.material_num,2) total_price, round(dm.distribut_price * mi.material_num *100 /(100+ ifnull(dm.tax_amount,0)) ,2) total_price_tax,
mi.depart_id , mi.distribut_contract_id ,mi.purchase_contract_id, mi.material_num,
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'
mi.arrive_time ,mi.remark,mi.id 'material_in_id',mi.good_code,mi.sparepart_id,ss.sparepart_code,ss.sparepart_name, ss.specification,ss.measuring_unit
from erp_material_in mi
left join erp_distribut_material dm on (dm.good_code = mi.good_code and dm.contract_id = mi.distribut_contract_id)
left join erp_distribut_contract dc on mi.distribut_contract_id = dc.id
left join sys_depart d on d.id = mi.depart_id
left join equipment_sparepart_supplies ss on mi.sparepart_id = ss.id
left join erp_purchase_material pm on (pm.contract_id =mi.purchase_contract_id and pm.good_code = mi.good_code )
left join erp_material_acceptance_form mf on mf.id = mi.id
where mi.audit_status = 3
......
......@@ -60,11 +60,16 @@
group by sparepart_id,purchase_contract_id,depart_id,supplier_id
</select>
<select id="queryById" resultType="com.skua.modules.erp.entity.MaterialIN">
select d.depart_name 'departName', st.item_text 'sparepartTypeName', sm.supp_name 'supplierName', t.* from erp_material_in t
left join sys_depart d on t.depart_id = d.id
left join equipment_sparepart_type st on st.id = t.sparepart_type
left join ajh_supplier_manage sm on sm.id = t.supplier_id
<select id="queryById" resultType="com.skua.modules.erp.vo.MaterialINVO">
select d.depart_name 'departName', ss.sparepart_code,ss.sparepart_name, st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name',ss.sparepart_name, ss.specification,ss.measuring_unit,
dm.tax_amount,dm.distribut_price,t.distribut_material_id,t.sparepart_type,t.distribut_total_price , t.distribut_total_price 'total_price',
t.id,t.depart_id,t.project_name,t.in_order,t.purchase_contract_id,t.purchase_contract_code,t.distribut_contract_id,t.distribut_contract_code,t.arrive_time,t.receiver,t.sparepart_id,t.material_num,t.supplier_id,t.good_code,t.share_url,t.confirm_status,t.audit_status,t.approve_message,t.in_type
from erp_material_in t
left join sys_depart d on t.depart_id = d.id
left join equipment_sparepart_supplies ss on t.sparepart_id = ss.id
left join equipment_sparepart_type st on st.id = t.sparepart_type
left join ajh_supplier_manage sm on sm.id = t.supplier_id
left join erp_distribut_material dm on (dm.contract_id = t.distribut_contract_id and dm.good_code = t.good_code)
where t.id = #{id}
</select>
<!-- 批量送审-->
......
......@@ -9,21 +9,25 @@
</delete>
<!-- 根据计划编号获取采购清单列表 -->
<select id="queryListByContractId" resultType="com.skua.modules.erp.entity.PurchaseMaterial">
select ss.sparepart_code,ss.sparepart_name, st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name', m.* from erp_purchase_material m
left join equipment_sparepart_supplies ss on m.sparepart_id = ss.id
left join equipment_sparepart_type st on st.id = m.sparepart_type
left join ajh_supplier_manage sm on sm.id = m.supplier_id
where m.contract_id = #{contractId}
<select id="queryListByContractId" resultType="com.skua.modules.erp.vo.PurchaseMaterialVO">
select st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name',
ss.sparepart_name, ss.sparepart_code,ss.specification,ss.measuring_unit,
m.id,m.sparepart_id, m.depart_id, m.contract_id,m.sparepart_type,m.good_code,m.supplier_id,m.purchase_num,m.unit_price,m.total_price,m.tax_amount,m.total_price_tax,m.good_origin,m.good_brand
from erp_purchase_material m
left join equipment_sparepart_supplies ss on m.sparepart_id = ss.id
left join equipment_sparepart_type st on st.id = m.sparepart_type
left join ajh_supplier_manage sm on sm.id = m.supplier_id
where m.contract_id = #{contractId}
</select>
<!-- 分页查询拥有权限的采购合同物料清单-->
<select id="queryByPage" resultType="com.skua.modules.erp.entity.PurchaseMaterial">
select ss.sparepart_code,ss.sparepart_name, st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name', aaa.*
select st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name', aaa.* ,
ss.sparepart_name, ss.sparepart_code,ss.specification,ss.measuring_unit
from (
select m.* from erp_purchase_material m , erp_purchase_contract pc where m.contract_id = pc.id and pc.use_flag='0'
<if test="goodCode != null and goodCode != ''">
<if test="goodCode != null and goodCode != ''">
AND m.good_code like concat('%', #{goodCode}, '%')
</if>
<if test="departId != null and departId != ''">
......@@ -35,13 +39,15 @@
left join ajh_supplier_manage sm on sm.id = aaa.supplier_id
</select>
<select id="queryMaterialByGoodCode" resultType="com.skua.modules.erp.entity.PurchaseMaterial">
select st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name', pm.*
<select id="queryMaterialByGoodCode" resultType="com.skua.modules.erp.vo.PurchaseMaterialVO">
select st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name', pm.* ,
ss.sparepart_name, ss.sparepart_code,ss.specification,ss.measuring_unit
from (
select m.* from erp_purchase_material m , erp_purchase_contract c
where m.contract_id = c.id and c.status = 3 and c.use_flag = '0' and c.start_time &lt;= now() and c.end_time &gt;= now()
and m.good_code = #{goodCode} and m.depart_id in(${departIds})
) pm
left join equipment_sparepart_supplies ss on pm.sparepart_id = ss.id
left join equipment_sparepart_type st on st.id = pm.sparepart_type
left join ajh_supplier_manage sm on sm.id = pm.supplier_id
......@@ -55,7 +61,7 @@
</select>
<!-- 药剂入库查询结果:物料清单-->
<select id="queryPurchaseMaterialListByIn" resultType="com.skua.modules.erp.vo.PurchaseMaterialVO">
select dc.contract_code 'distribut_contract_code', st.item_text as 'sparepart_type_name', aaa.* from
<!-- select dc.contract_code 'distribut_contract_code', st.item_text as 'sparepart_type_name', aaa.* from
(select pc.start_time ,pc.end_time , dm.distribut_price ,dm.distribut_total_price,dm.material_num ,pc.id 'purchase_contract_id', pc.contract_code 'purchase_contract_code' ,dm.contract_id 'distribut_contract_id', pm.*
from erp_distribut_material dm , erp_purchase_material pm ,erp_purchase_contract pc
where dm.good_code = pm.good_code and pm.contract_id = pc.id and pc.use_flag = '0' and dm.del_flag = '0' and pm.del_flag = '0' and pc.start_time &lt;= now() and pc.end_time &gt;= now()
......@@ -65,7 +71,23 @@
<if test="param.sparepartName != null and param.sparepartName !=''">and pm.sparepart_name like '%${param.sparepartName}%'</if>
) aaa
left join erp_distribut_contract dc on dc.id = aaa.distribut_contract_id
left join equipment_sparepart_type st on st.id = aaa.sparepart_type
left join equipment_sparepart_type st on st.id = aaa.sparepart_type-->
select aaa.* ,ss.sparepart_code,ss.sparepart_type , ss.sparepart_name, ss.specification,ss.measuring_unit , st.item_text as 'sparepart_type_name' , dc.contract_code 'distribut_contract_code'
from (
select dm.id, dm.id 'distribut_material_id', dm.contract_id 'distribut_contract_id',dm.good_code, dm.distribut_price ,dm.distribut_total_price,dm.distribut_total_price 'total_price',dm.material_num,dm.sparepart_id,
pc.contract_code 'purchase_contract_code',pc.id 'purchase_contract_id',pm.supplier_id
from erp_distribut_material dm , erp_purchase_material pm ,erp_purchase_contract pc
where dm.good_code = pm.good_code and pm.contract_id = pc.id and pc.use_flag = '0' and dm.del_flag = '0' and pm.del_flag = '0' and pc.start_time &lt;= now() and pc.end_time &gt;= now()
and dm.contract_id = #{param.distributContractId }
<if test="param.sparepartCode != null and param.sparepartCode !=''">and pm.sparepart_code =#{param.sparepartCode}</if>
<if test="param.sparepartType != null and param.sparepartType !=''">and pm.sparepart_type in (${param.sparepartType}) </if>
<if test="param.sparepartName != null and param.sparepartName !=''">and pm.sparepart_name like '%${param.sparepartName}%'</if>
) aaa
left join equipment_sparepart_supplies ss on aaa.sparepart_id = ss.id
left join equipment_sparepart_type st on st.id = ss.sparepart_type
left join erp_distribut_contract dc on dc.id = aaa.distribut_contract_id
</select>
<!-- 根据id或code校验合同编号是否唯一-->
<select id="checkContractCode" resultType="java.lang.Integer">
......
......@@ -6,6 +6,7 @@ import com.skua.modules.erp.entity.DistributMaterial;
import com.skua.modules.erp.entity.PurchaseMaterial;
import com.skua.modules.erp.entity.PurchasePlanItem;
import com.skua.modules.erp.vo.DistributContractVO;
import com.skua.modules.erp.vo.DistributMaterialVO;
import com.skua.modules.erp.vo.PurchaseContractVO;
import com.skua.modules.erp.vo.PurchasePlanVO;
......@@ -55,7 +56,7 @@ public interface IDistributContractService extends IService<DistributContract> {
* @param contractId
* @return
*/
List<DistributMaterial> queryListByContractId(String contractId);
List<DistributMaterialVO> queryListByContractId(String contractId);
/***
* 审批 分销合同
......
......@@ -71,7 +71,7 @@ public interface IERPPurchaseContractService extends IService<ERPPurchaseContrac
* @param contractId
* @return
*/
List<PurchaseMaterial> queryListByContractId(String contractId);
List<PurchaseMaterialVO> queryListByContractId(String contractId);
/***
* 审批 采购合同
......
......@@ -36,21 +36,21 @@ public interface IMaterialINService extends IService<MaterialIN> {
/***
* 药剂入库
* @param materialIN
* @param materialINVO
*/
String saveMaterialIN(MaterialIN materialIN);
String saveMaterialIN(MaterialINVO materialINVO);
/***
* 药剂入库
* @param materialIN
* @param materialINVO
*/
String updateMaterialIN(MaterialIN materialIN);
String updateMaterialIN(MaterialINVO materialINVO);
/***
* 根据id查询入库单
* @param id
* @return
*/
MaterialIN queryById(String id);
MaterialINVO queryById(String id);
/***
* 批量审批
......
package com.skua.modules.erp.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.skua.core.context.BaseContextHandler;
import com.skua.modules.erp.entity.ApproveRecord;
import com.skua.modules.erp.entity.DistributContract;
......@@ -11,6 +12,7 @@ import com.skua.modules.erp.mapper.DistributMaterialMapper;
import com.skua.modules.erp.mapper.PurchaseMaterialMapper;
import com.skua.modules.erp.service.IDistributContractService;
import com.skua.modules.erp.vo.DistributContractVO;
import com.skua.modules.erp.vo.DistributMaterialVO;
import com.skua.modules.erp.vo.PurchasePlanVO;
import com.skua.modules.system.mapper.SysDepartMapper;
import org.apache.commons.lang3.StringUtils;
......@@ -67,7 +69,7 @@ public class DistributContractServiceImpl extends ServiceImpl<DistributContractM
}
if( distributContractVO.getMaterialList() != null && !distributContractVO.getMaterialList().isEmpty()){
for(DistributMaterial material : distributContractVO.getMaterialList()){
for(DistributMaterialVO material : distributContractVO.getMaterialList()){
//根据deptid与goodscode校验
count = checkGoodCodeAndDepartId( material.getGoodCode(),null );
if(count > checkCount ){
......@@ -86,9 +88,9 @@ public class DistributContractServiceImpl extends ServiceImpl<DistributContractM
* @param materialList
* @return
*/
public String checkSameGoodCode(List<DistributMaterial> materialList){
public String checkSameGoodCode(List<DistributMaterialVO> materialList){
String goodCode = "";
for( DistributMaterial material : materialList){
for( DistributMaterialVO material : materialList){
if(goodCode.contains( material.getGoodCode() )){
goodCode = material.getGoodCode();
break;
......@@ -105,12 +107,16 @@ public class DistributContractServiceImpl extends ServiceImpl<DistributContractM
public String saveDistributContractVO(DistributContractVO distributContractVO){
int count = this.baseMapper.insert( distributContractVO );
DistributMaterial distributMaterial = null;
if(count > 0 && distributContractVO.getMaterialList() != null && !distributContractVO.getMaterialList().isEmpty()){
for(DistributMaterial material : distributContractVO.getMaterialList()){
material.setId(null);
material.setContractId( distributContractVO.getId() );
material.setDepartId(distributContractVO.getDepartId() ) ;//冗余所属厂站
materialMapper.insert( material );
for(DistributMaterialVO distributMaterialVO : distributContractVO.getMaterialList()){
//BeanUtils.copyProperties(原对象, 目标对象);
distributMaterial = new DistributMaterial();
BeanUtil.copyProperties(distributMaterialVO, distributMaterial);
distributMaterial.setId(null);
distributMaterial.setContractId( distributContractVO.getId() );
distributMaterial.setDepartId(distributContractVO.getDepartId() ) ;//冗余所属厂站
materialMapper.insert( distributMaterial );
}
}
baseMapper.updateDistributMoney(distributContractVO.getId());//修改分销合同的分销价格
......@@ -129,12 +135,16 @@ public class DistributContractServiceImpl extends ServiceImpl<DistributContractM
// ge根据计划编号删除清单集合
materialMapper.delByContractId(distributContractVO.getId() ) ;
DistributMaterial distributMaterial = null;
if(count > 0 && distributContractVO.getMaterialList() != null && !distributContractVO.getMaterialList().isEmpty()){
for(DistributMaterial material : distributContractVO.getMaterialList()){
material.setId(null);
material.setContractId( distributContractVO.getId() );
material.setDepartId(distributContractVO.getDepartId() ) ;//冗余所属厂站
materialMapper.insert( material );
for(DistributMaterialVO distributMaterialVO : distributContractVO.getMaterialList()){
//BeanUtils.copyProperties(原对象, 目标对象);
distributMaterial = new DistributMaterial();
BeanUtil.copyProperties(distributMaterialVO, distributMaterial);
distributMaterial.setId(null);
distributMaterial.setContractId( distributContractVO.getId() );
distributMaterial.setDepartId(distributContractVO.getDepartId() ) ;//冗余所属厂站
materialMapper.insert( distributMaterial );
}
}
baseMapper.updateDistributMoney(distributContractVO.getId());//修改分销合同的分销价格
......@@ -191,7 +201,7 @@ public class DistributContractServiceImpl extends ServiceImpl<DistributContractM
DistributContractVO distributContractVO = new DistributContractVO();
if(distributContract != null ){
BeanUtils.copyProperties(distributContract,distributContractVO);
List<DistributMaterial> materialList = materialMapper.queryListByContractId( contractId );
List<DistributMaterialVO> materialList = materialMapper.queryListByContractId( contractId );
distributContractVO.setMaterialList( materialList );
}
return distributContractVO;
......@@ -202,8 +212,8 @@ public class DistributContractServiceImpl extends ServiceImpl<DistributContractM
* @param contractId
* @return
*/
public List<DistributMaterial> queryListByContractId(String contractId){
List<DistributMaterial> planItemList = materialMapper.queryListByContractId( contractId );
public List<DistributMaterialVO> queryListByContractId(String contractId){
List<DistributMaterialVO> planItemList = materialMapper.queryListByContractId( contractId );
return planItemList;
}
......@@ -226,11 +236,15 @@ public class DistributContractServiceImpl extends ServiceImpl<DistributContractM
this.baseMapper.updateById( distributContractVO ) ;
// ge根据计划编号删除清单集合
materialMapper.delByContractId(distributContractVO.getId() ) ;
DistributMaterial distributMaterial = null;
if( distributContractVO.getMaterialList() != null && !distributContractVO.getMaterialList().isEmpty()){
for(DistributMaterial material : distributContractVO.getMaterialList()){
material.setId(null);
material.setContractId( distributContractVO.getId() );
materialMapper.insert( material );
for(DistributMaterialVO distributMaterialVO : distributContractVO.getMaterialList()){
//BeanUtils.copyProperties(原对象, 目标对象);
distributMaterial = new DistributMaterial();
BeanUtil.copyProperties(distributMaterialVO, distributMaterial);
distributMaterial.setId(null);
distributMaterial.setContractId( distributContractVO.getId() );
materialMapper.insert( distributMaterial );
}
}
//审批记录
......
package com.skua.modules.erp.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.skua.core.context.BaseContextHandler;
import com.skua.modules.equipment.dto.EquipmentInDTO;
import com.skua.modules.equipment.entity.EquipmentInChild;
......@@ -11,6 +12,7 @@ import com.skua.modules.erp.mapper.PurchaseMaterialMapper;
import com.skua.modules.erp.service.IERPPurchaseContractService;
import com.skua.modules.erp.vo.MaterialSearchVO;
import com.skua.modules.erp.vo.PurchaseContractVO;
import com.skua.modules.erp.vo.PurchaseMaterialVO;
import com.skua.modules.guest.util.DateUtil;
import com.skua.modules.quartz.util.BaseUtil;
import com.skua.modules.system.service.ISysConfigService;
......@@ -73,7 +75,7 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
}
}
if( purchaseContractVO.getMaterialList()!= null && !purchaseContractVO.getMaterialList().isEmpty()){
for(PurchaseMaterial purchaseMaterial : purchaseContractVO.getMaterialList()){
for(PurchaseMaterialVO purchaseMaterial : purchaseContractVO.getMaterialList()){
if(StringUtils.isNotEmpty(purchaseMaterial.getGoodCode())){
count = purchaseMaterialMapper.checkGoodCode(null,purchaseMaterial.getGoodCode());
if(count > checkCount ){
......@@ -100,7 +102,7 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
int count = 0;
if( purchaseContractVO.getMaterialList()!= null && !purchaseContractVO.getMaterialList().isEmpty()){
for(PurchaseMaterial purchaseMaterial : purchaseContractVO.getMaterialList()){
for(PurchaseMaterialVO purchaseMaterial : purchaseContractVO.getMaterialList()){
if(StringUtils.isNotEmpty(purchaseMaterial.getGoodCode())){
count = purchaseMaterialMapper.checkGoodCode(purchaseMaterial.getId(),purchaseMaterial.getGoodCode());
if(count > checkCount ){
......@@ -119,16 +121,22 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
* 新增purchaseContractVO
* @param purchaseContractVO
*/
@Transactional
public void savePurchaseContract(PurchaseContractVO purchaseContractVO){
int count = this.baseMapper.insert( purchaseContractVO );
//计算采购金额
String purchaseMoney = "0";
PurchaseMaterial purchaseMaterial = null;
if(count > 0 && purchaseContractVO.getMaterialList() != null && !purchaseContractVO.getMaterialList().isEmpty()){
for(PurchaseMaterial material : purchaseContractVO.getMaterialList()){
material.setId(null);
material.setContractId( purchaseContractVO.getId() );
purchaseMaterialMapper.insert( material );
purchaseMoney = BaseUtil.add(purchaseMoney, material.getTotalPrice());
for(PurchaseMaterialVO materialVO : purchaseContractVO.getMaterialList()){
//BeanUtils.copyProperties(原对象, 目标对象);
purchaseMaterial = new PurchaseMaterial();
BeanUtil.copyProperties(materialVO, purchaseMaterial);
purchaseMaterial.setId(null);
purchaseMaterial.setContractId( purchaseContractVO.getId() );
purchaseMaterialMapper.insert( purchaseMaterial );
purchaseMoney = BaseUtil.add(purchaseMoney, purchaseMaterial.getTotalPrice());
}
}
......@@ -152,12 +160,16 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
purchaseMaterialMapper.delByContractId( purchaseContractVO.getId() ) ;
//计算采购金额
String purchaseMoney = "0";
PurchaseMaterial purchaseMaterial = null;
if( purchaseContractVO.getMaterialList() != null && !purchaseContractVO.getMaterialList().isEmpty()){
for(PurchaseMaterial material : purchaseContractVO.getMaterialList()){
material.setId(null);
material.setContractId( purchaseContractVO.getId() );
purchaseMaterialMapper.insert( material );
purchaseMoney = BaseUtil.add(purchaseMoney, material.getTotalPrice());
for(PurchaseMaterialVO materialVO : purchaseContractVO.getMaterialList()){
//BeanUtils.copyProperties(原对象, 目标对象);
purchaseMaterial = new PurchaseMaterial();
BeanUtil.copyProperties(materialVO, purchaseMaterial);
purchaseMaterial.setId(null);
purchaseMaterial.setContractId( purchaseContractVO.getId() );
purchaseMaterialMapper.insert( purchaseMaterial );
purchaseMoney = BaseUtil.add(purchaseMoney, purchaseMaterial.getTotalPrice());
}
}
purchaseContractVO.setPurchaseMoney( purchaseMoney );
......@@ -189,12 +201,16 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
this.baseMapper.insert( purchaseContractVO );
//计算采购金额
String purchaseMoney = "0";
PurchaseMaterial purchaseMaterial = null;
if( purchaseContractVO.getMaterialList() != null && !purchaseContractVO.getMaterialList().isEmpty()){
for(PurchaseMaterial material : purchaseContractVO.getMaterialList()){
material.setId(null);
material.setContractId( purchaseContractVO.getId() );
purchaseMaterialMapper.insert( material );
purchaseMoney = BaseUtil.add(purchaseMoney, material.getTotalPrice());
for(PurchaseMaterialVO materialVO : purchaseContractVO.getMaterialList()){
//BeanUtils.copyProperties(原对象, 目标对象);
purchaseMaterial = new PurchaseMaterial();
BeanUtil.copyProperties(materialVO, purchaseMaterial);
purchaseMaterial.setId(null);
purchaseMaterial.setContractId( purchaseContractVO.getId() );
purchaseMaterialMapper.insert( purchaseMaterial );
purchaseMoney = BaseUtil.add(purchaseMoney, purchaseMaterial.getTotalPrice());
}
}
purchaseContractVO.setPurchaseMoney( purchaseMoney );
......@@ -221,7 +237,7 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
if(ERPPurchaseContract != null ){
BeanUtils.copyProperties(ERPPurchaseContract,purchaseContractVO);
List<PurchaseMaterial> materialList = purchaseMaterialMapper.queryListByContractId( contractId );
List<PurchaseMaterialVO> materialList = purchaseMaterialMapper.queryListByContractId( contractId );
purchaseContractVO.setMaterialList( materialList );
}
return purchaseContractVO;
......@@ -232,8 +248,8 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
* @param contractId
* @return
*/
public List<PurchaseMaterial> queryListByContractId(String contractId){
List<PurchaseMaterial> planItemList = purchaseMaterialMapper.queryListByContractId( contractId );
public List<PurchaseMaterialVO> queryListByContractId(String contractId){
List<PurchaseMaterialVO> planItemList = purchaseMaterialMapper.queryListByContractId( contractId );
return planItemList;
}
/***
......@@ -257,11 +273,15 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
// ge根据计划编号删除清单集合
purchaseMaterialMapper.delByContractId(purchaseContractVO.getId() ) ;
PurchaseMaterial purchaseMaterial = null;
if( purchaseContractVO.getMaterialList() != null && !purchaseContractVO.getMaterialList().isEmpty()){
for(PurchaseMaterial material : purchaseContractVO.getMaterialList()){
material.setId(null);
material.setContractId( purchaseContractVO.getId() );
purchaseMaterialMapper.insert( material );
for(PurchaseMaterialVO materialVO : purchaseContractVO.getMaterialList()){
//BeanUtils.copyProperties(原对象, 目标对象);
purchaseMaterial = new PurchaseMaterial();
BeanUtil.copyProperties(materialVO, purchaseMaterial);
purchaseMaterial.setId(null);
purchaseMaterial.setContractId( purchaseContractVO.getId() );
purchaseMaterialMapper.insert( purchaseMaterial );
}
}
//审批记录
......@@ -326,7 +346,7 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
List<EquipmentInChild> equipmentInChildrenList = new ArrayList<>();
EquipmentInChild equipmentInChild = null;//new EquipmentInChild();//
if(purchaseContractVO.getMaterialList() != null ){
for( PurchaseMaterial purchaseMaterial : purchaseContractVO.getMaterialList()){
for( PurchaseMaterialVO purchaseMaterial : purchaseContractVO.getMaterialList()){
equipmentInChild = new EquipmentInChild();//
equipmentInChild.setSparepartId( purchaseMaterial.getSparepartId());//物料编号
equipmentInChild.setInNum( new BigDecimal(purchaseMaterial.getPurchaseNum())); //物料数量
......
package com.skua.modules.erp.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.skua.core.context.BaseContextHandler;
......@@ -23,6 +24,7 @@ import com.skua.modules.erp.service.IMaterialINService;
import com.skua.modules.erp.service.IPurchaseMaterialService;
import com.skua.modules.erp.vo.ArrivalRecordExcelExportVO;
import com.skua.modules.erp.vo.MaterialINVO;
import com.skua.modules.erp.vo.PurchaseMaterialVO;
import com.skua.modules.guest.util.DateUtil;
import com.skua.modules.quartz.util.BaseUtil;
import com.skua.modules.supplies.entity.PurchaseContract;
......@@ -198,35 +200,88 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia
}
/***
* 药剂入库
* @param materialIN
* @param materialINVO
*/
@Transactional
public String saveMaterialIN(MaterialIN materialIN){
public String saveMaterialIN(MaterialINVO materialINVO){
//根据货号查询统购合同编号
QueryWrapper<PurchaseMaterial> queryWrapper = new QueryWrapper<PurchaseMaterial>();
/* QueryWrapper<PurchaseMaterial> queryWrapper = new QueryWrapper<PurchaseMaterial>();
queryWrapper.eq("good_code",materialIN.getGoodCode());
List<PurchaseMaterial> purchaseMaterialList = purchaseMaterialService.list(queryWrapper);
if(purchaseMaterialList != null && !purchaseMaterialList.isEmpty()){
materialIN.setPurchaseContractId(purchaseMaterialList.get(0).getPurchaseContractId());
materialIN.setSupplierId(purchaseMaterialList.get(0).getSupplierId());
}*/
MaterialIN materialIN = new MaterialIN();
//BeanUtils.copyProperties(原对象, 目标对象);
BeanUtil.copyProperties(materialINVO, materialIN);
PurchaseMaterialVO purchaseMaterialVO = null;
if(materialINVO.getMateriaList() != null && ! materialINVO.getMateriaList().isEmpty()){
purchaseMaterialVO = materialINVO.getMateriaList().get(0);
}
if(purchaseMaterialVO != null){
materialIN.setPurchaseContractCode(purchaseMaterialVO.getPurchaseContractCode());
materialIN.setPurchaseContractId(purchaseMaterialVO.getPurchaseContractId());
materialIN.setDistributContractCode(purchaseMaterialVO.getDistributContractCode());
materialIN.setDistributContractId(purchaseMaterialVO.getDistributContractId());
materialIN.setDistributMaterialId(purchaseMaterialVO.getDistributMaterialId());
materialIN.setDistributTotalPrice(purchaseMaterialVO.getDistributTotalPrice());
materialIN.setTotalPrice(purchaseMaterialVO.getDistributTotalPrice());
materialIN.setMaterialNum(purchaseMaterialVO.getMaterialNum());
materialIN.setSparepartId(purchaseMaterialVO.getSparepartId());
materialIN.setSparepartType(purchaseMaterialVO.getSparepartType());
materialIN.setGoodCode(purchaseMaterialVO.getGoodCode());
materialIN.setSupplierId(purchaseMaterialVO.getSupplierId());
//
}
this.baseMapper.insert(materialIN);
MaterialAcceptanceForm materialAcceptanceForm = new MaterialAcceptanceForm();
materialAcceptanceForm.setId( materialIN.getId() ) ;
materialAcceptanceForm.setDepartId(materialIN.getDepartId());
materialAcceptanceForm.setGoodCode(materialIN.getGoodCode());
materialAcceptanceForm.setPurchaseContractCode(materialIN.getPurchaseContractCode());
materialAcceptanceForm.setDistributContractCode(materialIN.getDistributContractCode());
materialAcceptanceFormService.save(materialAcceptanceForm);
return null;
}
@Transactional
public String updateMaterialIN(MaterialIN materialIN){
//根据货号查询统购合同编号
QueryWrapper<PurchaseMaterial> queryWrapper = new QueryWrapper<PurchaseMaterial>();
queryWrapper.eq("good_code",materialIN.getGoodCode());
List<PurchaseMaterial> purchaseMaterialList = purchaseMaterialService.list(queryWrapper);
if(purchaseMaterialList != null && !purchaseMaterialList.isEmpty()){
materialIN.setPurchaseContractId(purchaseMaterialList.get(0).getPurchaseContractId());
materialIN.setSupplierId(purchaseMaterialList.get(0).getSupplierId());
public String updateMaterialIN(MaterialINVO materialINVO){
MaterialIN materialIN = new MaterialIN();
//BeanUtils.copyProperties(原对象, 目标对象);
BeanUtil.copyProperties(materialINVO, materialIN);
PurchaseMaterialVO purchaseMaterialVO = null;
if(materialINVO.getMateriaList() != null && !materialINVO.getMateriaList().isEmpty()){
purchaseMaterialVO = materialINVO.getMateriaList().get(0);
}
if(purchaseMaterialVO != null){
materialIN.setPurchaseContractCode(purchaseMaterialVO.getPurchaseContractCode());
materialIN.setPurchaseContractId(purchaseMaterialVO.getPurchaseContractId());
materialIN.setDistributContractCode(purchaseMaterialVO.getDistributContractCode());
materialIN.setDistributContractId(purchaseMaterialVO.getDistributContractId());
materialIN.setDistributMaterialId(purchaseMaterialVO.getDistributMaterialId());
materialIN.setDistributTotalPrice(purchaseMaterialVO.getDistributTotalPrice());
materialIN.setTotalPrice(purchaseMaterialVO.getDistributTotalPrice());
materialIN.setMaterialNum(purchaseMaterialVO.getMaterialNum());
materialIN.setSparepartId(purchaseMaterialVO.getSparepartId());
materialIN.setSparepartType(purchaseMaterialVO.getSparepartType());
materialIN.setGoodCode(purchaseMaterialVO.getGoodCode());
materialIN.setSupplierId(purchaseMaterialVO.getSupplierId());
}
this.baseMapper.updateById(materialIN );
int index = this.baseMapper.updateById(materialIN );
MaterialAcceptanceForm materialAcceptanceForm = new MaterialAcceptanceForm();
materialAcceptanceForm.setId( materialIN.getId() ) ;
materialAcceptanceForm.setDepartId(materialIN.getDepartId());
materialAcceptanceForm.setGoodCode(materialIN.getGoodCode());
materialAcceptanceForm.setPurchaseContractCode(materialIN.getPurchaseContractCode());
materialAcceptanceForm.setDistributContractCode(materialIN.getDistributContractCode());
materialAcceptanceFormService.updateById(materialAcceptanceForm);
return null;
}
/***
......@@ -234,8 +289,20 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia
* @param id
* @return
*/
public MaterialIN queryById(String id){
return this.baseMapper.queryById(id );
public MaterialINVO queryById(String id){
MaterialINVO materialINVO = this.baseMapper.queryById(id );
PurchaseMaterialVO purchaseMaterialVO = new PurchaseMaterialVO();
//MaterialIN materialIN = new MaterialIN();
//BeanUtils.copyProperties(原对象, 目标对象);
BeanUtil.copyProperties(materialINVO, purchaseMaterialVO);
purchaseMaterialVO.setId( materialINVO.getDistributMaterialId() );
List<PurchaseMaterialVO> materiaList = new ArrayList<>();
materiaList.add( purchaseMaterialVO );
materialINVO.setMateriaList(materiaList);
return materialINVO;
}
/***
......
......@@ -23,7 +23,7 @@ public class DistributContractVO extends DistributContract {
@TableField(exist=false)
@ApiModelProperty(value = "采购合同物料清单集合")
private List<DistributMaterial> materialList = null;
private List<DistributMaterialVO> materialList = null;
/**审批意见*/
@TableField(exist=false)
......
package com.skua.modules.erp.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* erp分销物料
*/
@Data
@ApiModel(value="erp_distribut_material对象", description="erp分销物料")
public class DistributMaterialVO {
@ApiModelProperty(value = "主键")
private String id;
/**部门编号冗余*/
private String departId;
@ApiModelProperty(value = "厂站名称")
private String departName;
/**分销合同编号*/
@Excel(name = "分销合同编号", width = 15)
@ApiModelProperty(value = "分销合同编号")
private String contractId;
@ApiModelProperty(value = "统购合同编号")
private String purchaseContractId;
@ApiModelProperty(value = "物料编号")
private String sparepartId;
/**规格型号*/
@Excel(name = "规格型号", width = 15)
@ApiModelProperty(value = "规格型号")
private java.lang.String specification;
/**计量单位*/
@Excel(name = "计量单位", width = 15)
@ApiModelProperty(value = "计量单位")
private java.lang.String measuringUnit;
@ApiModelProperty(value = "物料类别名称")
private String sparepartCode;
@ApiModelProperty(value = "物料类别名称")
private String sparepartTypeName;
@ApiModelProperty(value = "物料名称")
private String sparepartName;
/**货号*/
@Excel(name = "货号", width = 15)
@ApiModelProperty(value = "货号")
private String goodCode;
/**物料数量*/
@Excel(name = "物料数量", width = 15)
@ApiModelProperty(value = "物料数量")
private String materialNum;
/**单价*/
@Excel(name = "分销单价", width = 15)
@ApiModelProperty(value = "分销单价")
private String distributPrice;
/**总价*/
@Excel(name = "分销总价", width = 15)
@ApiModelProperty(value = "分销总价")
private String distributTotalPrice;
/**税额*/
@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 remarks;
}
......@@ -4,6 +4,8 @@ import com.skua.modules.erp.entity.ErpSettlementItem;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* 药剂结算单详情
*/
......@@ -22,13 +24,31 @@ public class ErpSettlementItemVO extends ErpSettlementItem {
@ApiModelProperty(value = "合同编码")
private String contractCode;
@ApiModelProperty(value = "供应商名称")
private String supplierName;
@ApiModelProperty(value = "部门名称")
private String departName;
@ApiModelProperty(value = "单价")
private String unitPrice;
/**规格型号*/
@ApiModelProperty(value = "规格型号")
private java.lang.String specification;
/**计量单位*/
@ApiModelProperty(value = "计量单位")
private java.lang.String measuringUnit;
@ApiModelProperty(value = "物料类别名称")
private String sparepartCode;
@ApiModelProperty(value = "物料类别名称")
private String sparepartTypeName;
@ApiModelProperty(value = "物料名称")
private String sparepartName;
@ApiModelProperty(value = "技术文件/资料")
private String jishuFilePath;
......
......@@ -2,11 +2,16 @@ package com.skua.modules.erp.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.skua.modules.erp.entity.MaterialIN;
import com.skua.tool.util.JSUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = false)
......@@ -14,9 +19,78 @@ import lombok.experimental.Accessors;
@ApiModel(value="MaterialINVO查询对象", description="MaterialINVO查询对象")
public class MaterialINVO extends MaterialIN {
/**税额*/
@ApiModelProperty(value = "税额")
private String taxAmount;
/**药剂(物料)名称*/
@Excel(name = "药剂(物料)名称", width = 15)
@ApiModelProperty(value = "药剂(物料)名称")
private String sparepartName;
@ApiModelProperty(value = "物料编码")
private String sparepartCode;
/**规格型号*/
@Excel(name = "规格型号", width = 15)
@ApiModelProperty(value = "规格型号")
private String specification;
/**计量单位*/
@Excel(name = "计量单位", width = 15)
@ApiModelProperty(value = "计量单位")
private String measuringUnit;
/**审批状态*/
@TableField(exist=false)
@ApiModelProperty(value = "审批状态 1通过2不通过")
private String approveState;
@TableField(exist = false)
@ApiModelProperty(value = "物料类别")
private String sparepartTypeName;
@TableField(exist = false)
@ApiModelProperty(value = "供应商名称")
private String supplierName;
@TableField(exist = false)
private String departName;
/**采购单价*/
@ApiModelProperty(value = "采购单价")
private String purchasePrice;
/**分销单价*/
@ApiModelProperty(value = "分销单价")
private String distributPrice;
/**采购总价*/
@TableField(exist = false)
@ApiModelProperty(value = "采购总价")
private String purchaseTotalPrice;
/**价税合计*/
@TableField(exist = false)
@ApiModelProperty(value = "总价(不含税)")
private String totalPriceTax;
@ApiModelProperty(value = "药剂列表")
private List<PurchaseMaterialVO> materiaList;
public String getPurchaseTotalPrice() {
if(StringUtils.isNotEmpty(this.getPurchasePrice()) && StringUtils.isNotEmpty(this.getMaterialNum())){
purchaseTotalPrice = JSUtils.multiply(purchasePrice ,this.getMaterialNum()) ;
}
return purchaseTotalPrice;
}
public String getTotalPriceTax() {
//不含税总价 = 含税总价 / (1 + 税率)
if(StringUtils.isNotEmpty(this.getTaxAmount()) && StringUtils.isNotEmpty(this.getDistributPrice()) && StringUtils.isNotEmpty(this.getMaterialNum())){
String expression = distributPrice +" * " +this.getMaterialNum() +"/( 1 +"+taxAmount+"* 0.01)";
totalPriceTax = JSUtils.executeExpression(expression ,"0.00" ) ;
}
return totalPriceTax;
}
}
......
......@@ -22,7 +22,7 @@ public class PurchaseContractVO extends ERPPurchaseContract {
@TableField(exist=false)
@ApiModelProperty(value = "采购合同物料清单集合")
private List<PurchaseMaterial> materialList = null;
private List<PurchaseMaterialVO> materialList = null;
/**审批状态*/
@TableField(exist=false)
......
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;
......@@ -16,10 +15,26 @@ public class PurchaseMaterialVO {
/**主键*/
@ApiModelProperty(value = "主键")
private java.lang.String id;
@ApiModelProperty(value = "部门编号")
private String departId;
/**采购计划编号*/
@Excel(name = "采购合同编号", width = 15)
@ApiModelProperty(value = "采购合同编号")
private java.lang.String contractId;
@ApiModelProperty(value = "统购合同编号")
private String purchaseContractId;
@ApiModelProperty(value = "统购合同Code")
private String purchaseContractCode;
@ApiModelProperty(value = "分销合同编号")
private String distributContractId;
@ApiModelProperty(value = "分销合同Code")
private String distributContractCode;
@ApiModelProperty(value = "分销物料编号")
private String distributMaterialId;
/**物料类别编号*/
@Excel(name = "物料类别编号", width = 15)
@ApiModelProperty(value = "物料类别编号")
......@@ -57,50 +72,47 @@ public class PurchaseMaterialVO {
@ApiModelProperty(value = "总价")
private String totalPrice;
@Excel(name = "品牌", width = 15)
@ApiModelProperty(value = "品牌")
private String goodOrigin;
@Excel(name = "产地", width = 15)
@ApiModelProperty(value = "产地")
private String goodBrand;
@Excel(name = "物料数量", width = 15)
@ApiModelProperty(value = "物料数量")
private String materialNum;
/**单价*/
@Excel(name = "分销单价", width = 15)
@ApiModelProperty(value = "分销单价")
private String distributPrice;
/**总价*/
@Excel(name = "分销总价", width = 15)
@ApiModelProperty(value = "分销总价")
private String distributTotalPrice;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private java.lang.String remark;
@ApiModelProperty(value = "税额")
private String taxAmount;
@TableField(exist=false)
@ApiModelProperty(value = "物料类别名称")
private String sparepartCode;
@TableField(exist=false)
@ApiModelProperty(value = "物料类别名称")
private String sparepartTypeName;
@TableField(exist=false)
@ApiModelProperty(value = "物料名称")
private String sparepartName;
@TableField(exist=false)
@ApiModelProperty(value = "供应商名称")
private String supplierName;
@TableField(exist=false)
@ApiModelProperty(value = "厂站名称")
private String departName;
@ApiModelProperty(value = "转换属性:单价")
private String purchasePrice;
@ApiModelProperty(value = "转换属性:采购总价")
private String purchaseTotalPrice;
......
......@@ -105,8 +105,9 @@ public class WorkAnalysisController {
if(currentDate.toString().equals(endTime)){
index = 0 ;
}
String sql = "select count(d.id) 'departNum', (DATEDIFF('"+endTime+"', '"+startTime+"') +1) 'day_num' , (month('"+endTime+"') - month('"+startTime+"')+"+index+" ) month_num,";
sql += " ifnull(sum(aaa.count),0) 'nh_num' ,ifnull(sum(bbb.count),0) 'szsl_num' ,ifnull(sum(ccc.count),0) 'hy_num' ,ifnull(sum(ddd.count),0) 'yy_month_num',ifnull(sum(fff.count),0) 'df_month_num' ,ifnull(sum(ggg.count),0) 'year_target_num' ";
String sql = "select count(d.id) 'departNum', (DATEDIFF('"+endTime+"', '"+startTime+"') +"+index+") 'day_num' , (month('"+endTime+"') - month('"+startTime+"')+1 ) month_num,";
sql += " ifnull(sum(aaa.count),0) 'nh_num' ,ifnull(sum(bbb.count),0) 'szsl_num' ,ifnull(sum(ccc.count),0) 'hy_num' ,ifnull(sum(ddd.count),0) 'yy_month_num',ifnull(sum(fff.count),0) 'df_month_num' ,ifnull(sum(ggg.count),0) 'year_target_num' ,";
sql += " ifnull(sum(aaaHH.count),0) 'nhJsNum',ifnull(sum(bbbHH.count),0) 'szslJsNum',ifnull(sum(cccHH.count),0) 'hyJsNum' ";
sql += " from sys_depart d ";
sql += getWorkProgressSql(departIds, startTime, endTime, month);
sql += " where d.depart_type =1 ";
......@@ -213,21 +214,29 @@ public class WorkAnalysisController {
//能耗日报: 污泥量、电量合计,用水量
String view3a24Sql = ReportViewUtil.buildView(ReportConstant.view3a24,"WNL,DLHJ,YSL",departIds,startTime,endTime);
sql += " left join (select aa.depart_id ,count(1) 'count' from "+view3a24Sql+ " aa where aa.WNL is not null and aa.WNL <> '' and aa.DLHJ is not null and aa.DLHJ <> '' and aa.YSL is not null and aa.YSL <> '' group by aa.depart_id )aaa on aaa.depart_id = d.id ";
// 能耗日报 及时天数
sql += " left join (select aa.depart_id ,count(1) 'count' from "+view3a24Sql+ " aa where aa.WNL is not null and aa.WNL <> '' and aa.DLHJ is not null and aa.DLHJ <> '' and aa.YSL is not null and aa.YSL <> '' and DATEDIFF(aa.create_time , aa.time) < 2 group by aa.depart_id )aaaHH on aaaHH.depart_id = d.id ";
//水质水量日报表:进水量、出水量、PH进水、PH出水、COD进水、COD出水,TP进水、TP出水、NH4-N进水、出水; TN进水、出水
String view2119Sql = ReportViewUtil.buildView(ReportConstant.view2119,"JSL,CSL,JSAD,CSAD,JSZD,CSTN,JSZL,CSZL,JSCOD,CSCOD,JSPH,CSPH",departIds,startTime,endTime);
sql += " left join ( select bb.depart_id ,count(1) 'count' from "+view2119Sql+ " bb ";
sql += " where bb.JSL is not null and bb.JSL <> '' and bb.CSL is not null and bb.CSL <> '' and bb.JSAD is not null and bb.JSAD <> '' and bb.CSAD is not null and bb.CSAD <> '' ";
sql += " and bb.JSZD is not null and bb.JSZD <> '' and bb.CSTN is not null and bb.CSTN <> '' and bb.JSZL is not null and bb.JSZL <> '' and bb.CSZL is not null and bb.CSZL <> '' ";
sql += " and bb.JSCOD is not null and bb.JSCOD <> '' and bb.CSCOD is not null and bb.CSCOD <> '' and bb.JSPH is not null and bb.JSPH <> '' and bb.CSPH is not null and bb.CSPH <> '' ";
sql += " group by bb.depart_id )bbb on bbb.depart_id = d.id ";
String view2119Sql_where = " where bb.JSL is not null and bb.JSL <> '' and bb.CSL is not null and bb.CSL <> '' and bb.JSAD is not null and bb.JSAD <> '' and bb.CSAD is not null and bb.CSAD <> '' ";
view2119Sql_where += " and bb.JSZD is not null and bb.JSZD <> '' and bb.CSTN is not null and bb.CSTN <> '' and bb.JSZL is not null and bb.JSZL <> '' and bb.CSZL is not null and bb.CSZL <> '' ";
view2119Sql_where += " and bb.JSCOD is not null and bb.JSCOD <> '' and bb.CSCOD is not null and bb.CSCOD <> '' and bb.JSPH is not null and bb.JSPH <> '' and bb.CSPH is not null and bb.CSPH <> '' ";
sql += " left join ( select bb.depart_id ,count(1) 'count' from "+view2119Sql+ " bb " +view2119Sql_where+ " group by bb.depart_id )bbb on bbb.depart_id = d.id";
//水质水量日报 及时天数
sql += " left join ( select bb.depart_id ,count(1) 'count' from "+view2119Sql+ " bb " +view2119Sql_where+ " and DATEDIFF(bb.create_time , bb.time) < 2 group by bb.depart_id )bbbHH on bbbHH.depart_id = d.id";
//化验日报 ==化验数据:PH进水、PH出水、COD进水、COD出水、TP进水、TP出水、NH4-N进水、出水; TN进水、出水
String viewbffaSql = ReportViewUtil.buildView(ReportConstant.view9bff,"JSPHHY,CSPHHY,JSCODHY,CSCODHY,JSZLHY,CSZLHY,CSTNHY,JSZDHY,JSADHY,CSADHY",departIds,startTime,endTime);
sql += " left join (select cc.depart_id ,count(1) 'count' from "+viewbffaSql+ " cc ";
sql += " where cc.JSPHHY is not null and cc.JSPHHY <> '' and cc.CSPHHY is not null and cc.CSPHHY <> '' and cc.JSCODHY is not null and cc.JSCODHY <> '' and cc.CSCODHY is not null and cc.CSCODHY <> '' ";
sql += " and cc.JSZLHY is not null and cc.JSZLHY <> '' and cc.CSZLHY is not null and cc.CSZLHY <> '' and cc.CSTNHY is not null and cc.CSTNHY <> '' and cc.JSZDHY is not null and cc.JSZDHY <> '' ";
sql += " and cc.JSADHY is not null and cc.JSADHY <> '' and cc.CSADHY is not null and cc.CSADHY <> '' ";
sql += " group by cc.depart_id )ccc on ccc.depart_id = d.id ";
String viewbffaSql_where = " where cc.JSPHHY is not null and cc.JSPHHY <> '' and cc.CSPHHY is not null and cc.CSPHHY <> '' and cc.JSCODHY is not null and cc.JSCODHY <> '' and cc.CSCODHY is not null and cc.CSCODHY <> '' ";
viewbffaSql_where += " and cc.JSZLHY is not null and cc.JSZLHY <> '' and cc.CSZLHY is not null and cc.CSZLHY <> '' and cc.CSTNHY is not null and cc.CSTNHY <> '' and cc.JSZDHY is not null and cc.JSZDHY <> '' ";
viewbffaSql_where += " and cc.JSADHY is not null and cc.JSADHY <> '' and cc.CSADHY is not null and cc.CSADHY <> '' ";
sql += " left join (select cc.depart_id ,count(1) 'count' from "+viewbffaSql+ " cc "+ viewbffaSql_where +" group by cc.depart_id )ccc on ccc.depart_id = d.id ";
sql += " left join (select cc.depart_id ,count(1) 'count' from "+viewbffaSql+ " cc "+ viewbffaSql_where +" and DATEDIFF(cc.create_time , cc.time) < 2 group by cc.depart_id )cccHH on cccHH.depart_id = d.id ";
//电费月报
sql += " left join( select ec.depart_id , count(1) 'count' from report_electric_cost ec where ec.month = '"+month+"' and ec.cost is not null and ec.cost <> '' group by ec.depart_id ) ddd on ddd.depart_id = d.id ";
......
......@@ -34,6 +34,14 @@ public class WorkProgressVO {
private Integer szslNum;
@ApiModelProperty(value = "化验报表-填报天数")
private Integer hyNum;
@ApiModelProperty(value = "能耗-及时天数")
private Integer nhJsNum;
@ApiModelProperty(value = "水质水量-及时天数")
private Integer szslJsNum;
@ApiModelProperty(value = "化验报表-及时天数")
private Integer hyJsNum;
@ApiModelProperty(value = "运营月报-填报月数")
private Integer yyMonthNum;
@ApiModelProperty(value = "电费月报-填报月数")
......
......@@ -87,5 +87,5 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
* @param roleId
* @return
*/
List<SysUser> queryUserByRoleId(@Param("roleId") String roleId);
List<SysUser> queryUserByRoleId(@Param("roleId") String roleId,@Param("departId") String departId);
}
......
......@@ -46,9 +46,6 @@
u.del_flag = '0'
AND u.is_system_user = '0'
AND u.id IN ( SELECT user_id FROM sys_user_role WHERE role_id = #{roleId} )
<if test="username!=null and username!=''">
AND (u.username LIKE CONCAT('%',#{username},'%') or u.realname LIKE CONCAT('%',#{username},'%'))
</if>
<if test="departId!=null and departId!=''">
AND d.dep_id IN
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
......
......@@ -6,6 +6,7 @@ import com.skua.core.util.push.MessageEntity;
import com.skua.core.util.push.PushMessageFactory;
import com.skua.modules.system.entity.SysUser;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
......@@ -17,6 +18,7 @@ import java.util.stream.Collectors;
*/
@Service
public class SmsService {
@Autowired
private ISysUserService userService;
public void pushMsgNoProcessByRoleId(String messageTitle ,String messageBody ,String roleId,String forwardTag){
......
......@@ -184,7 +184,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@Override
public List<SysUser> queryUserByRoleId(String roleId) {
return this.baseMapper.queryUserByRoleId(roleId);
//String ids = commonSqlMapper.getChildDepartByUserId(BaseContextHandler.getUserId());
//String departIds = commonSqlMapper.getChildDeparts(ids);
String departIds = null;
return this.baseMapper.queryUserByRoleId(roleId,departIds);
}
//获取登录人所属集团
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!