Merge remote-tracking branch 'origin/master' into master
正在显示
18 个修改的文件
包含
217 行增加
和
32 行删除
... | @@ -419,6 +419,18 @@ public class JSUtils { | ... | @@ -419,6 +419,18 @@ public class JSUtils { |
419 | return str; | 419 | return str; |
420 | } | 420 | } |
421 | 421 | ||
422 | public static String quoteEach(List<String> idList,String splitStr) { | ||
423 | if( idList != null && !idList.isEmpty() ){ | ||
424 | String result = ""; | ||
425 | for(String id : idList){ | ||
426 | if(result.length()>0) result +=","; | ||
427 | result += "'"+ id +"'"; | ||
428 | } | ||
429 | return result; | ||
430 | } | ||
431 | return ""; | ||
432 | } | ||
433 | |||
422 | 434 | ||
423 | /*** | 435 | /*** |
424 | * 计算时间的前几个月的月份 | 436 | * 计算时间的前几个月的月份 | ... | ... |
... | @@ -56,10 +56,11 @@ public class ErpSettlementController { | ... | @@ -56,10 +56,11 @@ public class ErpSettlementController { |
56 | Result<IPage<ErpSettlement>> result = new Result<IPage<ErpSettlement>>(); | 56 | Result<IPage<ErpSettlement>> result = new Result<IPage<ErpSettlement>>(); |
57 | QueryWrapper<ErpSettlement> queryWrapper = new QueryWrapper();// QueryGenerator.initQueryWrapper(erpSettlement, req.getParameterMap()); | 57 | QueryWrapper<ErpSettlement> queryWrapper = new QueryWrapper();// QueryGenerator.initQueryWrapper(erpSettlement, req.getParameterMap()); |
58 | Page<ErpSettlement> page = new Page<ErpSettlement>(pageNo, pageSize); | 58 | Page<ErpSettlement> page = new Page<ErpSettlement>(pageNo, pageSize); |
59 | 59 | //水务公司 | |
60 | if(StringUtils.isNotEmpty(erpSettlementSearchVO.getDepartId())){ | 60 | if(StringUtils.isNotEmpty(erpSettlementSearchVO.getDepartId())){ |
61 | queryWrapper.eq("depart_id" ,erpSettlementSearchVO.getDepartId()) ; | 61 | queryWrapper.eq("depart_id" ,erpSettlementSearchVO.getDepartId()) ; |
62 | } | 62 | } |
63 | //供应商 | ||
63 | if(StringUtils.isNotEmpty(erpSettlementSearchVO.getSupplierId())){ | 64 | if(StringUtils.isNotEmpty(erpSettlementSearchVO.getSupplierId())){ |
64 | queryWrapper.eq("supplier_id" ,erpSettlementSearchVO.getSupplierId()) ; | 65 | queryWrapper.eq("supplier_id" ,erpSettlementSearchVO.getSupplierId()) ; |
65 | } | 66 | } | ... | ... |
... | @@ -22,6 +22,7 @@ import com.skua.modules.equipment.service.ISupplierManageService; | ... | @@ -22,6 +22,7 @@ import com.skua.modules.equipment.service.ISupplierManageService; |
22 | import com.skua.modules.erp.entity.ERPPurchaseContract; | 22 | import com.skua.modules.erp.entity.ERPPurchaseContract; |
23 | import com.skua.modules.erp.entity.MaterialAcceptanceForm; | 23 | import com.skua.modules.erp.entity.MaterialAcceptanceForm; |
24 | import com.skua.modules.erp.entity.MaterialIN; | 24 | import com.skua.modules.erp.entity.MaterialIN; |
25 | import com.skua.modules.erp.service.IDistributContractService; | ||
25 | import com.skua.modules.erp.service.IERPPurchaseContractService; | 26 | import com.skua.modules.erp.service.IERPPurchaseContractService; |
26 | import com.skua.modules.erp.service.IMaterialAcceptanceFormService; | 27 | import com.skua.modules.erp.service.IMaterialAcceptanceFormService; |
27 | import com.skua.modules.erp.service.IMaterialINService; | 28 | import com.skua.modules.erp.service.IMaterialINService; |
... | @@ -37,6 +38,7 @@ import com.skua.modules.supplies.service.IEquipmentSparepartSuppliesService; | ... | @@ -37,6 +38,7 @@ import com.skua.modules.supplies.service.IEquipmentSparepartSuppliesService; |
37 | import com.skua.modules.supplies.service.IEquipmentSparepartTypeService; | 38 | import com.skua.modules.supplies.service.IEquipmentSparepartTypeService; |
38 | import com.skua.modules.system.entity.SysDepart; | 39 | import com.skua.modules.system.entity.SysDepart; |
39 | import com.skua.modules.system.service.ISysDepartService; | 40 | import com.skua.modules.system.service.ISysDepartService; |
41 | import com.skua.tool.util.JSUtils; | ||
40 | import lombok.extern.slf4j.Slf4j; | 42 | import lombok.extern.slf4j.Slf4j; |
41 | 43 | ||
42 | import org.apache.commons.lang3.StringUtils; | 44 | import org.apache.commons.lang3.StringUtils; |
... | @@ -84,7 +86,7 @@ public class MaterialINController { | ... | @@ -84,7 +86,7 @@ public class MaterialINController { |
84 | @Autowired | 86 | @Autowired |
85 | private IMaterialAcceptanceFormService materialAcceptanceFormService;//验收单 | 87 | private IMaterialAcceptanceFormService materialAcceptanceFormService;//验收单 |
86 | @Autowired | 88 | @Autowired |
87 | private IEquipmentSparepartTypeService sparepartTypeService; | 89 | private IDistributContractService distributContractService;//分销合同编号 |
88 | /** | 90 | /** |
89 | * <pre> | 91 | * <pre> |
90 | * 分页列表查询 | 92 | * 分页列表查询 |
... | @@ -164,7 +166,23 @@ public class MaterialINController { | ... | @@ -164,7 +166,23 @@ public class MaterialINController { |
164 | if(StringUtils.isNotBlank(materialIN.getEndTime())){ | 166 | if(StringUtils.isNotBlank(materialIN.getEndTime())){ |
165 | queryWrapper.le("arrive_time",materialIN.getEndTime()); | 167 | queryWrapper.le("arrive_time",materialIN.getEndTime()); |
166 | }*/ | 168 | }*/ |
167 | 169 | //全部确认的数据 | |
170 | queryWrapper.eq("confirm_status","9"); | ||
171 | //检索采购合同 | ||
172 | if(StringUtils.isNotEmpty(req.getParameter("purchaseContractCode"))){ | ||
173 | List<String> purchaseContractIdList = purchaseContractService.selectIdsByCode(req.getParameter("purchaseContractCode")); | ||
174 | //purchaseContractIds | ||
175 | if(purchaseContractIdList != null && !purchaseContractIdList.isEmpty()){ | ||
176 | queryWrapper.in("purchase_contract_id", JSUtils.quoteEach(purchaseContractIdList,",")); | ||
177 | } | ||
178 | } | ||
179 | //检索分销合同 | ||
180 | if(StringUtils.isNotEmpty(req.getParameter("distributContractCode"))){ | ||
181 | List<String> distributContractIdList = distributContractService.selectIdsByCode(req.getParameter("distributContractCode")); | ||
182 | if(distributContractIdList != null && !distributContractIdList.isEmpty()){ | ||
183 | queryWrapper.in("distribut_contract_id", JSUtils.quoteEach(distributContractIdList,",")); | ||
184 | } | ||
185 | } | ||
168 | // 需要添加条件判断 | 186 | // 需要添加条件判断 |
169 | if(StringUtils.isEmpty(materialIN.getAuditStatus())){ | 187 | if(StringUtils.isEmpty(materialIN.getAuditStatus())){ |
170 | queryWrapper.gt("audit_status" , "0");// >0 | 188 | queryWrapper.gt("audit_status" , "0");// >0 |
... | @@ -181,10 +199,12 @@ public class MaterialINController { | ... | @@ -181,10 +199,12 @@ public class MaterialINController { |
181 | @AutoLog(value = "erp--物料(药剂)入库--药剂到货日验收记录") | 199 | @AutoLog(value = "erp--物料(药剂)入库--药剂到货日验收记录") |
182 | @ApiOperation(value="erp--物料(药剂)入库-药剂到货日验收记录", notes="erp--物料(药剂)入库-药剂到货日验收记录") | 200 | @ApiOperation(value="erp--物料(药剂)入库-药剂到货日验收记录", notes="erp--物料(药剂)入库-药剂到货日验收记录") |
183 | @GetMapping(value = "/arrivalRecordList") | 201 | @GetMapping(value = "/arrivalRecordList") |
184 | public Result<List<ArrivalRecordExcelExportVO>> arrivalRecordList(MaterialIN materialIN) { | 202 | public Result<List<MaterialIN>> arrivalRecordList(MaterialIN materialIN,@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
185 | Result<List<ArrivalRecordExcelExportVO>> result = new Result<List<ArrivalRecordExcelExportVO>>(); | 203 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
186 | /* QueryWrapper<MaterialIN> queryWrapper = new QueryWrapper();//QueryGenerator.initQueryWrapper(materialIN, req.getParameterMap()); | 204 | HttpServletRequest req) { |
187 | if(StringUtils.isNotBlank(materialIN.getGoodCode())){ | 205 | Result<List<MaterialIN>> result = new Result<List<MaterialIN>>(); |
206 | QueryWrapper<MaterialIN> queryWrapper = QueryGenerator.initQueryWrapper(materialIN, req.getParameterMap()); | ||
207 | /*if(StringUtils.isNotBlank(materialIN.getGoodCode())){ | ||
188 | queryWrapper.like("good_code",materialIN.getGoodCode()); | 208 | queryWrapper.like("good_code",materialIN.getGoodCode()); |
189 | } | 209 | } |
190 | if(StringUtils.isNotBlank(materialIN.getStartTime())){ | 210 | if(StringUtils.isNotBlank(materialIN.getStartTime())){ |
... | @@ -201,12 +221,12 @@ public class MaterialINController { | ... | @@ -201,12 +221,12 @@ public class MaterialINController { |
201 | } | 221 | } |
202 | if(StringUtils.isNotBlank(materialIN.getPurchaseContractId())){ | 222 | if(StringUtils.isNotBlank(materialIN.getPurchaseContractId())){ |
203 | queryWrapper.eq("purchase_contract_id",materialIN.getPurchaseContractId()); | 223 | queryWrapper.eq("purchase_contract_id",materialIN.getPurchaseContractId()); |
204 | } | 224 | }*/ |
205 | queryWrapper.eq("audit_status","3"); | 225 | queryWrapper.eq("audit_status","3"); |
206 | List<MaterialIN> pageList = materialINService.list( queryWrapper);*/ | 226 | List<MaterialIN> pageList = materialINService.list( queryWrapper); |
207 | 227 | ||
208 | 228 | ||
209 | List<ArrivalRecordExcelExportVO> pageList = materialINService.queryArrivalRecordByList(materialIN); | 229 | //List<ArrivalRecordExcelExportVO> pageList = materialINService.queryArrivalRecordByList(materialIN); |
210 | 230 | ||
211 | result.setSuccess(true); | 231 | result.setSuccess(true); |
212 | result.setResult(pageList); | 232 | result.setResult(pageList); | ... | ... |
... | @@ -45,12 +45,10 @@ public class MaterialIN { | ... | @@ -45,12 +45,10 @@ public class MaterialIN { |
45 | private String inOrder; | 45 | private String inOrder; |
46 | /**采购合同*/ | 46 | /**采购合同*/ |
47 | @Excel(name = "采购合同", width = 15) | 47 | @Excel(name = "采购合同", width = 15) |
48 | @ApiModelProperty(value = "采购合同") | ||
49 | @Dict(dictTable = "erp_purchase_contract", dicCode="id", dicText = "contract_code") | 48 | @Dict(dictTable = "erp_purchase_contract", dicCode="id", dicText = "contract_code") |
50 | private String purchaseContractId; | 49 | private String purchaseContractId; |
51 | /**分销合同*/ | 50 | /**分销合同*/ |
52 | @Excel(name = "分销合同", width = 15) | 51 | @Excel(name = "分销合同", width = 15) |
53 | @ApiModelProperty(value = "分销合同") | ||
54 | @Dict(dictTable = "erp_distribut_contract", dicCode="id", dicText = "contract_code") | 52 | @Dict(dictTable = "erp_distribut_contract", dicCode="id", dicText = "contract_code") |
55 | private String distributContractId; | 53 | private String distributContractId; |
56 | /**到货时间*/ | 54 | /**到货时间*/ |
... | @@ -88,7 +86,6 @@ public class MaterialIN { | ... | @@ -88,7 +86,6 @@ public class MaterialIN { |
88 | @ApiModelProperty(value = "计量单位") | 86 | @ApiModelProperty(value = "计量单位") |
89 | private String measuringUnit; | 87 | private String measuringUnit; |
90 | /**数量*/ | 88 | /**数量*/ |
91 | @Excel(name = "数量", width = 15) | ||
92 | @ApiModelProperty(value = "数量") | 89 | @ApiModelProperty(value = "数量") |
93 | private String purchaseNum; | 90 | private String purchaseNum; |
94 | 91 | ||
... | @@ -108,15 +105,12 @@ public class MaterialIN { | ... | @@ -108,15 +105,12 @@ public class MaterialIN { |
108 | @ApiModelProperty(value = "货号") | 105 | @ApiModelProperty(value = "货号") |
109 | private String goodCode; | 106 | private String goodCode; |
110 | /**采购单价*/ | 107 | /**采购单价*/ |
111 | @Excel(name = "采购单价", width = 15) | ||
112 | @ApiModelProperty(value = "采购单价") | 108 | @ApiModelProperty(value = "采购单价") |
113 | private String purchasePrice; | 109 | private String purchasePrice; |
114 | /**分销单价*/ | 110 | /**分销单价*/ |
115 | @Excel(name = "分销单价", width = 15) | ||
116 | @ApiModelProperty(value = "分销单价") | 111 | @ApiModelProperty(value = "分销单价") |
117 | private String distributPrice; | 112 | private String distributPrice; |
118 | /**采购总价*/ | 113 | /**采购总价*/ |
119 | @Excel(name = "采购总价", width = 15) | ||
120 | @ApiModelProperty(value = "采购总价") | 114 | @ApiModelProperty(value = "采购总价") |
121 | private String purchaseTotalPrice; | 115 | private String purchaseTotalPrice; |
122 | 116 | ||
... | @@ -124,7 +118,6 @@ public class MaterialIN { | ... | @@ -124,7 +118,6 @@ public class MaterialIN { |
124 | @ApiModelProperty(value = "物料数量") | 118 | @ApiModelProperty(value = "物料数量") |
125 | private String materialNum; | 119 | private String materialNum; |
126 | /**分销总价*/ | 120 | /**分销总价*/ |
127 | @Excel(name = "分销总价", width = 15) | ||
128 | @ApiModelProperty(value = "分销总价") | 121 | @ApiModelProperty(value = "分销总价") |
129 | private String distributTotalPrice; | 122 | private String distributTotalPrice; |
130 | /**税额*/ | 123 | /**税额*/ |
... | @@ -132,11 +125,9 @@ public class MaterialIN { | ... | @@ -132,11 +125,9 @@ public class MaterialIN { |
132 | @ApiModelProperty(value = "税额") | 125 | @ApiModelProperty(value = "税额") |
133 | private String taxAmount; | 126 | private String taxAmount; |
134 | /**价税合计*/ | 127 | /**价税合计*/ |
135 | @Excel(name = "价税合计", width = 15) | ||
136 | @ApiModelProperty(value = "价税合计") | 128 | @ApiModelProperty(value = "价税合计") |
137 | private String totalPriceTax; | 129 | private String totalPriceTax; |
138 | /**分享地址*/ | 130 | /**分享地址*/ |
139 | @Excel(name = "分享地址", width = 15) | ||
140 | @ApiModelProperty(value = "分享地址") | 131 | @ApiModelProperty(value = "分享地址") |
141 | private String shareUrl; | 132 | private String shareUrl; |
142 | /**确认状态:0 未确认 1 部分确认 2 全部确认*/ | 133 | /**确认状态:0 未确认 1 部分确认 2 全部确认*/ | ... | ... |
... | @@ -22,4 +22,11 @@ public interface DistributContractMapper extends BaseMapper<DistributContract> { | ... | @@ -22,4 +22,11 @@ public interface DistributContractMapper extends BaseMapper<DistributContract> { |
22 | * @param id | 22 | * @param id |
23 | */ | 23 | */ |
24 | void changePurchaseContract(@Param("id") String id); | 24 | void changePurchaseContract(@Param("id") String id); |
25 | |||
26 | /** | ||
27 | * 根据code 获取ids集合 | ||
28 | * @param contractCode | ||
29 | * @return | ||
30 | */ | ||
31 | List<String> selectIdsByCode(@Param("contractCode") String contractCode); | ||
25 | } | 32 | } | ... | ... |
... | @@ -26,4 +26,6 @@ public interface ERPPurchaseContractMapper extends BaseMapper<ERPPurchaseContrac | ... | @@ -26,4 +26,6 @@ public interface ERPPurchaseContractMapper extends BaseMapper<ERPPurchaseContrac |
26 | * @param contractId | 26 | * @param contractId |
27 | */ | 27 | */ |
28 | void changePurchaseContract(@Param("contractId") String contractId); | 28 | void changePurchaseContract(@Param("contractId") String contractId); |
29 | |||
30 | List<String> selectIdsByCode(@Param("contractCode") String contractCode); | ||
29 | } | 31 | } | ... | ... |
... | @@ -11,4 +11,9 @@ | ... | @@ -11,4 +11,9 @@ |
11 | update erp_distribut_contract set use_flag =1 where id = #{id} | 11 | update erp_distribut_contract set use_flag =1 where id = #{id} |
12 | </update> | 12 | </update> |
13 | 13 | ||
14 | |||
15 | <select id="selectIdsByCode" resultType="java.lang.String"> | ||
16 | select id from erp_distribut_contract where contract_code like CONCAT('%',#{contractCode},'%') | ||
17 | </select> | ||
18 | |||
14 | </mapper> | 19 | </mapper> | ... | ... |
... | @@ -16,4 +16,9 @@ | ... | @@ -16,4 +16,9 @@ |
16 | update erp_purchase_contract set use_flag = 1 where id = #{contractId} | 16 | update erp_purchase_contract set use_flag = 1 where id = #{contractId} |
17 | </update> | 17 | </update> |
18 | 18 | ||
19 | |||
20 | <select id="selectIdsByCode" resultType="java.lang.String"> | ||
21 | select id from erp_purchase_contract where contract_code like CONCAT('%',#{contractCode},'%') | ||
22 | </select> | ||
23 | |||
19 | </mapper> | 24 | </mapper> | ... | ... |
... | @@ -31,7 +31,7 @@ | ... | @@ -31,7 +31,7 @@ |
31 | and mi.supplier_id = #{supplierId} | 31 | and mi.supplier_id = #{supplierId} |
32 | </if> | 32 | </if> |
33 | </where> | 33 | </where> |
34 | order by arrive_time desc | 34 | order by mi.arrive_time desc |
35 | </select> | 35 | </select> |
36 | <!--获取入库审批列表:根据部门、采购合同、供应商、药剂分组搜索 --> | 36 | <!--获取入库审批列表:根据部门、采购合同、供应商、药剂分组搜索 --> |
37 | <select id="selectAuditMaterialINByPage" resultType="com.skua.modules.erp.vo.ArrivalRecordExcelExportVO"> | 37 | <select id="selectAuditMaterialINByPage" resultType="com.skua.modules.erp.vo.ArrivalRecordExcelExportVO"> | ... | ... |
... | @@ -68,4 +68,11 @@ public interface IDistributContractService extends IService<DistributContract> { | ... | @@ -68,4 +68,11 @@ public interface IDistributContractService extends IService<DistributContract> { |
68 | * @param distributContractVO | 68 | * @param distributContractVO |
69 | */ | 69 | */ |
70 | String changePurchaseContract(DistributContractVO distributContractVO); | 70 | String changePurchaseContract(DistributContractVO distributContractVO); |
71 | |||
72 | /*** | ||
73 | * 根据code 获取ids集合 | ||
74 | * @param contractCode | ||
75 | * @return | ||
76 | */ | ||
77 | List<String> selectIdsByCode(String contractCode); | ||
71 | } | 78 | } | ... | ... |
... | @@ -93,5 +93,10 @@ public interface IERPPurchaseContractService extends IService<ERPPurchaseContrac | ... | @@ -93,5 +93,10 @@ public interface IERPPurchaseContractService extends IService<ERPPurchaseContrac |
93 | */ | 93 | */ |
94 | List<ERPPurchaseContract> getListByDistributId(MaterialSearchVO materialSearchVO); | 94 | List<ERPPurchaseContract> getListByDistributId(MaterialSearchVO materialSearchVO); |
95 | 95 | ||
96 | 96 | /** | |
97 | * 根据code 获取ids集合 | ||
98 | * @param contractCode | ||
99 | * @return | ||
100 | */ | ||
101 | List<String> selectIdsByCode(String contractCode); | ||
97 | } | 102 | } | ... | ... |
... | @@ -152,6 +152,14 @@ public class DistributContractServiceImpl extends ServiceImpl<DistributContractM | ... | @@ -152,6 +152,14 @@ public class DistributContractServiceImpl extends ServiceImpl<DistributContractM |
152 | distributContractVO.setOldContractId(oldContractId);//保存变更前的的合同编号 | 152 | distributContractVO.setOldContractId(oldContractId);//保存变更前的的合同编号 |
153 | return this.updateDistributContractVO(distributContractVO); | 153 | return this.updateDistributContractVO(distributContractVO); |
154 | } | 154 | } |
155 | /*** | ||
156 | * 根据code 获取ids集合 | ||
157 | * @param contractCode | ||
158 | * @return | ||
159 | */ | ||
160 | public List<String> selectIdsByCode(String contractCode){ | ||
161 | return baseMapper.selectIdsByCode( contractCode); | ||
162 | } | ||
155 | 163 | ||
156 | /*** | 164 | /*** |
157 | * 根据所属厂长、以及goodcode校验是否存在 | 165 | * 根据所属厂长、以及goodcode校验是否存在 | ... | ... |
... | @@ -269,6 +269,15 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr | ... | @@ -269,6 +269,15 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr |
269 | public List<ERPPurchaseContract> getListByDistributId(MaterialSearchVO materialSearchVO){ | 269 | public List<ERPPurchaseContract> getListByDistributId(MaterialSearchVO materialSearchVO){ |
270 | return this.baseMapper.getListByDistributId(materialSearchVO); | 270 | return this.baseMapper.getListByDistributId(materialSearchVO); |
271 | } | 271 | } |
272 | /** | ||
273 | * 根据code 获取ids集合 | ||
274 | * @param contractCode | ||
275 | * @return | ||
276 | */ | ||
277 | public List<String> selectIdsByCode(String contractCode){ | ||
278 | return this.baseMapper.selectIdsByCode(contractCode); | ||
279 | } | ||
280 | |||
272 | /*** | 281 | /*** |
273 | * 同步入库 | 282 | * 同步入库 |
274 | * @param purchaseContractVO | 283 | * @param purchaseContractVO | ... | ... |
... | @@ -4,6 +4,7 @@ import com.skua.common.constant.ReportConstant; | ... | @@ -4,6 +4,7 @@ import com.skua.common.constant.ReportConstant; |
4 | import com.skua.common.report.ReportViewUtil; | 4 | import com.skua.common.report.ReportViewUtil; |
5 | import com.skua.core.api.vo.Result; | 5 | import com.skua.core.api.vo.Result; |
6 | import com.skua.core.context.SpringContextUtils; | 6 | import com.skua.core.context.SpringContextUtils; |
7 | import com.skua.modules.dataAnalysis.vo.SafeProgressVO; | ||
7 | import com.skua.modules.dataAnalysis.vo.WorkProgressVO; | 8 | import com.skua.modules.dataAnalysis.vo.WorkProgressVO; |
8 | import com.skua.tool.util.DateUtils; | 9 | import com.skua.tool.util.DateUtils; |
9 | import com.skua.tool.util.JSUtils; | 10 | import com.skua.tool.util.JSUtils; |
... | @@ -30,7 +31,7 @@ import java.util.List; | ... | @@ -30,7 +31,7 @@ import java.util.List; |
30 | public class WorkAnalysisController { | 31 | public class WorkAnalysisController { |
31 | 32 | ||
32 | 33 | ||
33 | @ApiOperation(value = "工作进度统计", notes = "工作进度统计 timeType = 1 表示月份,timeType=2 表示年") | 34 | @ApiOperation(value = "工作进度列表", notes = "工作进度列表 timeType = 1 表示月份,timeType=2 表示年") |
34 | @GetMapping("/analysisByWorkProgress") | 35 | @GetMapping("/analysisByWorkProgress") |
35 | public Result<List<WorkProgressVO>> analysisByWorkProgress(@RequestParam(defaultValue = "1") Integer timeType, String startTime, String endTime) { | 36 | public Result<List<WorkProgressVO>> analysisByWorkProgress(@RequestParam(defaultValue = "1") Integer timeType, String startTime, String endTime) { |
36 | Result<List<WorkProgressVO>> result = new Result<>(); | 37 | Result<List<WorkProgressVO>> result = new Result<>(); |
... | @@ -40,7 +41,7 @@ public class WorkAnalysisController { | ... | @@ -40,7 +41,7 @@ public class WorkAnalysisController { |
40 | } | 41 | } |
41 | String departIds = null;//DAY(LAST_DAY('"+startTime+"')) | 42 | String departIds = null;//DAY(LAST_DAY('"+startTime+"')) |
42 | String sql = "select d.id 'depart_id' , d.depart_name , (DATEDIFF('"+endTime+"', '"+startTime+"') +1) 'day_num' , (month('"+endTime+"') - month('"+startTime+"') + 1) month_num,ifnull(aaa.count,0) 'nh_num' ,ifnull(bbb.count,0) 'szsl_num' ,ifnull(ccc.count,0) 'hy_num' ,ifnull(ddd.count,0) 'yy_month_num',ifnull(fff.count,0) 'df_month_num' ,ifnull(ggg.count,0) 'year_target_num' from sys_depart d "; | 43 | String sql = "select d.id 'depart_id' , d.depart_name , (DATEDIFF('"+endTime+"', '"+startTime+"') +1) 'day_num' , (month('"+endTime+"') - month('"+startTime+"') + 1) month_num,ifnull(aaa.count,0) 'nh_num' ,ifnull(bbb.count,0) 'szsl_num' ,ifnull(ccc.count,0) 'hy_num' ,ifnull(ddd.count,0) 'yy_month_num',ifnull(fff.count,0) 'df_month_num' ,ifnull(ggg.count,0) 'year_target_num' from sys_depart d "; |
43 | sql += getSql(departIds, startTime, endTime, month); | 44 | sql += getWorkProgressSql(departIds, startTime, endTime, month); |
44 | sql += " where d.depart_type =1 "; | 45 | sql += " where d.depart_type =1 "; |
45 | if(StringUtils.isNotEmpty(departIds)){ | 46 | if(StringUtils.isNotEmpty(departIds)){ |
46 | sql += " d.id in ("+ JSUtils.quoteEach(departIds,",") +")"; | 47 | sql += " d.id in ("+ JSUtils.quoteEach(departIds,",") +")"; |
... | @@ -55,7 +56,7 @@ public class WorkAnalysisController { | ... | @@ -55,7 +56,7 @@ public class WorkAnalysisController { |
55 | return result; | 56 | return result; |
56 | } | 57 | } |
57 | 58 | ||
58 | @ApiOperation(value = "工作进度统计-数量", notes = "工作进度统计 timeType = 1 表示月份,timeType=2 表示年") | 59 | @ApiOperation(value = "工作进度统计-数量统计", notes = "工作进度-数量统计 timeType = 1 表示月份,timeType=2 表示年") |
59 | @GetMapping("/analysisTotalByWorkProgress") | 60 | @GetMapping("/analysisTotalByWorkProgress") |
60 | public Result<WorkProgressVO> analysisTotalByWorkProgress(@RequestParam(defaultValue = "1") Integer timeType, String startTime, String endTime) { | 61 | public Result<WorkProgressVO> analysisTotalByWorkProgress(@RequestParam(defaultValue = "1") Integer timeType, String startTime, String endTime) { |
61 | Result<WorkProgressVO> result = new Result<>(); | 62 | Result<WorkProgressVO> result = new Result<>(); |
... | @@ -68,7 +69,7 @@ public class WorkAnalysisController { | ... | @@ -68,7 +69,7 @@ public class WorkAnalysisController { |
68 | String sql = "select count(d.id) 'departNum', (DATEDIFF('"+endTime+"', '"+startTime+"') +1) 'day_num' , (month('"+endTime+"') - month('"+startTime+"') + 1) month_num,"; | 69 | String sql = "select count(d.id) 'departNum', (DATEDIFF('"+endTime+"', '"+startTime+"') +1) 'day_num' , (month('"+endTime+"') - month('"+startTime+"') + 1) month_num,"; |
69 | 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' "; | 70 | 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' "; |
70 | sql += " from sys_depart d "; | 71 | sql += " from sys_depart d "; |
71 | sql += getSql(departIds, startTime, endTime, month); | 72 | sql += getWorkProgressSql(departIds, startTime, endTime, month); |
72 | sql += " where d.depart_type =1 "; | 73 | sql += " where d.depart_type =1 "; |
73 | if(StringUtils.isNotEmpty(departIds)){ | 74 | if(StringUtils.isNotEmpty(departIds)){ |
74 | sql += " d.id in ("+ JSUtils.quoteEach(departIds,",") +")"; | 75 | sql += " d.id in ("+ JSUtils.quoteEach(departIds,",") +")"; |
... | @@ -83,7 +84,70 @@ public class WorkAnalysisController { | ... | @@ -83,7 +84,70 @@ public class WorkAnalysisController { |
83 | result.setSuccess(true); | 84 | result.setSuccess(true); |
84 | return result; | 85 | return result; |
85 | } | 86 | } |
86 | private String getSql( String departIds,String startTime, String endTime,String month){ | 87 | |
88 | |||
89 | @ApiOperation(value = "安全管理进度-数据列表", notes = "安全管理进度-数据列表 timeType = 1 表示月份,timeType=2 表示年") | ||
90 | @GetMapping("/analysisBySafeProgress") | ||
91 | public List<SafeProgressVO> analysisBySafeProgress(@RequestParam(defaultValue = "1") Integer timeType, String startTime, String endTime) { | ||
92 | JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtils.getBean("master"); | ||
93 | String departIds = null; | ||
94 | |||
95 | String sql = "select d.id 'depart_id' , d.depart_name , ifnull(aaa.count,0) 'meet_num', ifnull(bbb.count,0) 'meet_total', ifnull(ccc.count,0) 'exam_num', ifnull(ddd.count,0) 'exam_total',ifnull(eee.count, 0) 'frequency_num' , ifnull(fff.count , 0) 'frequency_total'"; | ||
96 | sql += " from sys_depart d "; | ||
97 | sql += getSafeProgressSql(departIds, startTime,endTime); | ||
98 | sql += " where d.depart_type =1 "; | ||
99 | if(StringUtils.isNotEmpty(departIds)){ | ||
100 | sql += " d.id in ("+ JSUtils.quoteEach(departIds,",") +")"; | ||
101 | } | ||
102 | sql += " order by (ifnull(aaa.count,0) + ifnull(bbb.count,0) + ifnull(ccc.count,0) + ifnull(ddd.count,0) + ifnull(fff.count,0) ) asc "; | ||
103 | System.out.println("sql = "+sql); | ||
104 | List<SafeProgressVO> dataList = jdbcTemplate.query(sql,new BeanPropertyRowMapper<SafeProgressVO>(SafeProgressVO.class)); | ||
105 | |||
106 | return dataList; | ||
107 | } | ||
108 | @ApiOperation(value = "安全管理进度统计-数量统计", notes = "安全管理进度-数量统计 timeType = 1 表示月份,timeType=2 表示年") | ||
109 | @GetMapping("/analysisTotalBySafeProgress") | ||
110 | public SafeProgressVO analysisTotalBySafeProgress(@RequestParam(defaultValue = "1") Integer timeType, String startTime, String endTime) { | ||
111 | String departIds = null;//DAY(LAST_DAY('"+startTime+"')) | ||
112 | String sql = "select count(d.id) 'departNum', ifnull(sum(aaa.count),0) 'meet_num' ,ifnull(sum(bbb.count),0) 'meet_total' ,ifnull(sum(ccc.count),0) 'exam_num' ,ifnull(sum(ddd.count),0) 'exam_total',ifnull(sum(eee.count),0) 'frequency_num' ,ifnull(sum(fff.count),0) 'frequency_total' "; | ||
113 | sql += " from sys_depart d "; | ||
114 | sql += getSafeProgressSql(departIds, startTime,endTime); | ||
115 | sql += " where d.depart_type =1 "; | ||
116 | if(StringUtils.isNotEmpty(departIds)){ | ||
117 | sql += " d.id in ("+ JSUtils.quoteEach(departIds,",") +")"; | ||
118 | } | ||
119 | System.out.println("sql = "+sql); | ||
120 | JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtils.getBean("master"); | ||
121 | List<SafeProgressVO> dataList = jdbcTemplate.query(sql,new BeanPropertyRowMapper<SafeProgressVO>(SafeProgressVO.class)); | ||
122 | if(dataList != null && !dataList.isEmpty()){ | ||
123 | return dataList.get(0); | ||
124 | } | ||
125 | return null; | ||
126 | } | ||
127 | private String getSafeProgressSql( String departIds,String startTime, String endTime){ | ||
128 | JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtils.getBean("master"); | ||
129 | String userIdsSql = "select GROUP_CONCAT( DISTINCT exam_user_ids) 'user_ids' from edu_paper where end_time >='"+startTime+"' and end_time <= '"+endTime+"'"; | ||
130 | String userIds = jdbcTemplate.queryForObject(userIdsSql , String.class); | ||
131 | if(StringUtils.isNotEmpty(userIds)){ | ||
132 | userIds = JSUtils.quoteEach(userIds,","); | ||
133 | }else{ | ||
134 | userIds = "''"; | ||
135 | } | ||
136 | String sql = ""; | ||
137 | //会议任务 | ||
138 | sql += " left join( select depart_id , count(1) 'count' from ajh_meeting_send where meet_status =2 and meet_end_time >='"+startTime+"' and meet_end_time <= '"+endTime+"' group by depart_id )aaa on aaa.depart_id = d.id "; | ||
139 | sql += " left join (select depart_id , count(1) 'count' from ajh_meeting_send where meet_id in (select id from ajh_meeting where end_time >='"+startTime+"' and end_time <= '"+endTime+"') group by depart_id ) bbb on bbb.depart_id = d.id "; | ||
140 | // 考试任务 | ||
141 | sql += " left join (select depart_id,count(user_id) 'count' from edu_user_paper where DATE_FORMAT(end_time,'%Y-%m-%d') >='"+startTime+"' and end_time <= '"+endTime+"' and user_id in("+userIds+") group by depart_id )ccc on ccc.depart_id = d.id"; | ||
142 | sql += " left join ( select dep_id,count(user_id) 'count' from sys_user_depart where user_id in("+userIds+") group by dep_id )ddd on ddd.dep_id = d.id"; | ||
143 | //风险排查任务 | ||
144 | sql += " left join ( select depart_id ,count(id) 'count' from danger_inspection_record where status = '2' and end_date >= '"+startTime+" 00:00:00' and end_date <='"+endTime+" 23:59:59' group by depart_id ) eee on eee.depart_id = d.id "; | ||
145 | sql += " left join( select sum( (DATEDIFF('"+endTime+"', '"+startTime+"') +1)*24/ dlm.frequency ) 'count' , dlm.depart_id from danger_level_manage dlm where dlm.frequency IS NOT NULL and frequency <> '' ) fff on fff.depart_id = d.id "; | ||
146 | |||
147 | return sql ; | ||
148 | } | ||
149 | |||
150 | private String getWorkProgressSql( String departIds,String startTime, String endTime,String month){ | ||
87 | String sql = ""; | 151 | String sql = ""; |
88 | //能耗日报 | 152 | //能耗日报 |
89 | String view3a24Sql = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ",departIds,startTime,endTime); | 153 | String view3a24Sql = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ",departIds,startTime,endTime); | ... | ... |
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/mapper/xml/PowerAnalysisNewMapper.xml
... | @@ -435,7 +435,7 @@ | ... | @@ -435,7 +435,7 @@ |
435 | </foreach> | 435 | </foreach> |
436 | order by ifnull(p1.ydl/p.clsl,0) desc | 436 | order by ifnull(p1.ydl/p.clsl,0) desc |
437 | </select> | 437 | </select> |
438 | 438 | <!-- 工艺分布--> | |
439 | <select id="queryCraftDSDH" resultType="java.util.Map"> | 439 | <select id="queryCraftDSDH" resultType="java.util.Map"> |
440 | SELECT | 440 | SELECT |
441 | p1.item_text `name`, | 441 | p1.item_text `name`, |
... | @@ -445,7 +445,7 @@ | ... | @@ -445,7 +445,7 @@ |
445 | ( | 445 | ( |
446 | SELECT | 446 | SELECT |
447 | sfi.pro_craft, | 447 | sfi.pro_craft, |
448 | ROUND(p1.ydl/p.clsl,2) AS dsdh | 448 | ROUND( avg(p1.ydl/p.clsl) ,2) AS dsdh |
449 | FROM | 449 | FROM |
450 | sys_factory_info sfi | 450 | sys_factory_info sfi |
451 | LEFT JOIN ( | 451 | LEFT JOIN ( |
... | @@ -488,7 +488,7 @@ | ... | @@ -488,7 +488,7 @@ |
488 | SELECT | 488 | SELECT |
489 | sfi.pro_craft, | 489 | sfi.pro_craft, |
490 | sfi.out_level, | 490 | sfi.out_level, |
491 | ROUND(p1.ydl/p.clsl,2) AS dsdh | 491 | ROUND(avg(p1.ydl/p.clsl),2) AS dsdh |
492 | FROM | 492 | FROM |
493 | sys_factory_info sfi | 493 | sys_factory_info sfi |
494 | LEFT JOIN ( | 494 | LEFT JOIN ( |
... | @@ -525,7 +525,7 @@ | ... | @@ -525,7 +525,7 @@ |
525 | <select id="queryScaleDSDH" resultType="java.util.Map"> | 525 | <select id="queryScaleDSDH" resultType="java.util.Map"> |
526 | SELECT | 526 | SELECT |
527 | sfi.*, | 527 | sfi.*, |
528 | ROUND(p1.ydl/p.clsl,2) AS dsdh | 528 | ROUND(ifnull(avg(p1.ydl/p.clsl),0),2) AS dsdh |
529 | FROM | 529 | FROM |
530 | sys_factory_info sfi | 530 | sys_factory_info sfi |
531 | LEFT JOIN ( | 531 | LEFT JOIN ( | ... | ... |
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/service/IPowerAnalysisNewService.java
... | @@ -18,7 +18,7 @@ public interface IPowerAnalysisNewService { | ... | @@ -18,7 +18,7 @@ public interface IPowerAnalysisNewService { |
18 | * 功能描述: <br>电耗分布情况 | 18 | * 功能描述: <br>电耗分布情况 |
19 | */ | 19 | */ |
20 | Map<String, Object> powerConsumptionDistribution(OperationMonthVO operationMonthVO); | 20 | Map<String, Object> powerConsumptionDistribution(OperationMonthVO operationMonthVO); |
21 | 21 | //电耗分析关联分析 | |
22 | Map<String, Object> powerAssociation(OperationMonthVO operationMonthVO); | 22 | Map<String, Object> powerAssociation(OperationMonthVO operationMonthVO); |
23 | 23 | ||
24 | Map<String, Object> powerDSDHCurve(String id, String type, String time); | 24 | Map<String, Object> powerDSDHCurve(String id, String type, String time); | ... | ... |
... | @@ -171,7 +171,7 @@ public class PowerAnalysisNewServiceImpl implements IPowerAnalysisNewService { | ... | @@ -171,7 +171,7 @@ public class PowerAnalysisNewServiceImpl implements IPowerAnalysisNewService { |
171 | result.put("factoryDistributionList", distributionList); | 171 | result.put("factoryDistributionList", distributionList); |
172 | return result; | 172 | return result; |
173 | } | 173 | } |
174 | 174 | //电耗分析关联分析 | |
175 | @Override | 175 | @Override |
176 | public Map<String, Object> powerAssociation(OperationMonthVO operationMonthVO) { | 176 | public Map<String, Object> powerAssociation(OperationMonthVO operationMonthVO) { |
177 | String time = operationMonthVO.getTime(); | 177 | String time = operationMonthVO.getTime(); | ... | ... |
1 | package com.skua.modules.dataAnalysis.vo; | ||
2 | |||
3 | /** | ||
4 | * @auther kangwei | ||
5 | * @create 2025-01-23-9:24 | ||
6 | */ | ||
7 | import io.swagger.annotations.ApiModel; | ||
8 | import io.swagger.annotations.ApiModelProperty; | ||
9 | import lombok.Data; | ||
10 | |||
11 | /** | ||
12 | * 工作进度 | ||
13 | */ | ||
14 | @Data | ||
15 | @ApiModel(value = "SafeProgressVO安全管理进度", description = "安全管理进度") | ||
16 | public class SafeProgressVO { | ||
17 | |||
18 | @ApiModelProperty(value = "所属厂站") | ||
19 | private String departId; | ||
20 | @ApiModelProperty(value = "所属厂站") | ||
21 | private String departName; | ||
22 | |||
23 | @ApiModelProperty(value = "所属厂站-数量") | ||
24 | private String departNum; | ||
25 | |||
26 | @ApiModelProperty(value = "会议任务--完成数量") | ||
27 | private Integer meetNum; | ||
28 | @ApiModelProperty(value = "会议任务--计划总数") | ||
29 | private Integer meetTotal; | ||
30 | @ApiModelProperty(value = "考试任务-完成数量") | ||
31 | private Integer examNum; | ||
32 | @ApiModelProperty(value = "考试任务-计划总数") | ||
33 | private Integer examTotal; | ||
34 | @ApiModelProperty(value = "巡检任务-完成数量") | ||
35 | private Integer frequencyNum; | ||
36 | @ApiModelProperty(value = "巡检任务-计划总数") | ||
37 | private Integer frequencyTotal; | ||
38 | |||
39 | @ApiModelProperty(value = "是否完成: 0 未完成 1 已完成") | ||
40 | private Integer completeFlag ; | ||
41 | |||
42 | public Integer getCompleteFlag() { | ||
43 | completeFlag = 0; | ||
44 | if((meetNum >= meetTotal) && (examNum >= examTotal) && (frequencyNum >= frequencyTotal)){ | ||
45 | completeFlag = 1; | ||
46 | } | ||
47 | return completeFlag; | ||
48 | } | ||
49 | } |
-
请 注册 或 登录 后发表评论