8b84e0e0 康伟

kangwei :修改bug

1 个父辈 bcf077ad
正在显示 25 个修改的文件 包含 450 行增加88 行删除
...@@ -217,17 +217,31 @@ public class ReportViewUtil { ...@@ -217,17 +217,31 @@ public class ReportViewUtil {
217 return sb.toString(); 217 return sb.toString();
218 } 218 }
219 219
220 /*****************************************************/ 220
221 /*** 221 /**
222 * 构造填报报表视图:按照部门分组统计 222 * 构造填报报表视图,时间模糊搜索
223 * @param reportId 报表编号 223 * * </pre>
224 * @param fields 查询字段 224 * * @param reportId 报表id
225 * @param startTime 开始时间 225 * * @param fields 查询字段
226 * @param endTime 结束时间 226 * * @param departIds 厂站集合
227 * * @param dataTime 开始时间
228 * * @param dataTime 结束时间
229 * @param operatorSign 运算符号 avg sum max min
227 * @return 230 * @return
228 */ 231 */
229 public static String buildViewByStatistics(String reportId,String fields,String startTime,String endTime) { 232 public static String buildViewLike(String reportId,String fields,String departIds,String startTime,String endTime,String operatorSign) {
233
234 //运算符号operatorSign
235 if(StringUtils.isEmpty(operatorSign)) operatorSign = "sum";
236 String inSqlPart = "";
230 String inItemSqlPart = ""; 237 String inItemSqlPart = "";
238 if(StringUtils.isNotEmpty(departIds)){
239 String[] departIdArray = departIds.split(",");
240 for(String departId : departIdArray) {
241 inSqlPart = inSqlPart + ",'"+departId+"'";
242 }
243 inSqlPart = inSqlPart.substring(1);
244 }
231 if(!StringUtils.isEmpty(fields)) { 245 if(!StringUtils.isEmpty(fields)) {
232 String[] fieldArray = fields.split(","); 246 String[] fieldArray = fields.split(",");
233 for(String field : fieldArray) { 247 for(String field : fieldArray) {
...@@ -242,6 +256,7 @@ public class ReportViewUtil { ...@@ -242,6 +256,7 @@ public class ReportViewUtil {
242 } 256 }
243 inItemSqlPart = inItemSqlPart.substring(1); 257 inItemSqlPart = inItemSqlPart.substring(1);
244 } 258 }
259
245 JdbcTemplate masterDB = (JdbcTemplate)SpringContextUtils.getBean("master"); 260 JdbcTemplate masterDB = (JdbcTemplate)SpringContextUtils.getBean("master");
246 String itemSql = "select item_code,id from f_report_item where report_id = '"+reportId+"' and required = 1 "; 261 String itemSql = "select item_code,id from f_report_item where report_id = '"+reportId+"' and required = 1 ";
247 if(!StringUtils.isEmpty(inItemSqlPart)) { 262 if(!StringUtils.isEmpty(inItemSqlPart)) {
...@@ -256,18 +271,27 @@ public class ReportViewUtil { ...@@ -256,18 +271,27 @@ public class ReportViewUtil {
256 for(Map<String,Object> itemMap : itemList) { 271 for(Map<String,Object> itemMap : itemList) {
257 itemCodes = itemCodes + ",'"+itemMap.get("item_code")+"'"; 272 itemCodes = itemCodes + ",'"+itemMap.get("item_code")+"'";
258 itemIds = itemIds +",'"+itemMap.get("id")+"'"; 273 itemIds = itemIds +",'"+itemMap.get("id")+"'";
259 sb.append("sum(if((`d`.`item_code` = '"+itemMap.get("item_code")+"'),`a`.`item_value`,NULL)) AS `"+itemMap.get("item_code")+"`,"); 274 sb.append( operatorSign + "(if((`d`.`item_code` = '"+itemMap.get("item_code")+"'),`a`.`item_value`,NULL)) AS `"+itemMap.get("item_code")+"`,");
260 } 275 }
261 if(!StringUtils.isEmpty(itemIds)) { 276 if(!StringUtils.isEmpty(itemIds)) {
262 itemIds = itemIds.substring(1); 277 itemIds = itemIds.substring(1);
263 } 278 }
264 sb.append("`a`.`depart_id` AS `depart_id` from (( "); 279 sb.append("`a`.`depart_id` AS `depart_id` from (( ");
280 sb.append("SELECT data_id,reit_id,item_value,data_time,depart_id FROM f_report_itemv WHERE 1=1 ");
265 281
266 sb.append("SELECT data_id,reit_id,item_value,data_time,depart_id FROM f_report_itemv v WHERE 1=1 "); 282 if(!StringUtils.isEmpty(departIds)) {
283 sb.append(" and depart_id in ("+inSqlPart+")");
284 }
267 if(!StringUtils.isEmpty(startTime)) { 285 if(!StringUtils.isEmpty(startTime)) {
268 sb.append("and data_time>='"+startTime+"' and data_time<='"+endTime+"' "); 286 sb.append("and data_time >='"+startTime+"'");
269 } 287 }
270 sb.append("and reit_id in ("+itemIds+")) `a` left join `f_report_item` `d` on(`a`.`reit_id` = `d`.`id`)) where 1=1 group by `a`.`depart_id`)"); 288 if(!StringUtils.isEmpty(endTime)) {
289 sb.append("and data_time <='"+endTime+"'");
290 }
291 sb.append("and reit_id in ("+itemIds+")");
292
293 sb.append(") `a` left join `f_report_item` `d` on((`a`.`reit_id` = `d`.`id`))) where 1=1 group by `a`.`depart_id`)");
271 return sb.toString(); 294 return sb.toString();
272 } 295 }
296
273 } 297 }
......
...@@ -27,11 +27,18 @@ public interface CommonSqlMapper { ...@@ -27,11 +27,18 @@ public interface CommonSqlMapper {
27 27
28 Page<Map<String, Object>> queryWrapperForPage(Page<?> page, @Param("sql") String sql, @Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper); 28 Page<Map<String, Object>> queryWrapperForPage(Page<?> page, @Param("sql") String sql, @Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper);
29 29
30
30 @Anonymous 31 @Anonymous
31 List<Map<String, Object>> queryForList(@Param("sql") String sql); 32 List<Map<String, Object>> queryForList(@Param("sql") String sql);
32 33
33 List<Map<String, Object>> queryWrapperForList(@Param("sql") String sql, @Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper); 34 List<Map<String, Object>> queryWrapperForList(@Param("sql") String sql, @Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper);
34 35
36 String queryForString(@Param("sql") String sql);
37
38 String queryWrapperForString(@Param("sql") String sql, @Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper);
39
40
41
35 Integer update(@Param("sql") String sql); 42 Integer update(@Param("sql") String sql);
36 43
37 Integer updateWrapper(@Param("tableName") String tableName, @Param(Constants.WRAPPER) UpdateWrapper<?> updateWrapper); 44 Integer updateWrapper(@Param("tableName") String tableName, @Param(Constants.WRAPPER) UpdateWrapper<?> updateWrapper);
......
...@@ -26,6 +26,14 @@ ...@@ -26,6 +26,14 @@
26 ${sql} ${ew.customSqlSegment} 26 ${sql} ${ew.customSqlSegment}
27 </select> 27 </select>
28 28
29
30 <select id="queryForString" resultType="java.lang.String">
31 ${sql}
32 </select>
33 <select id="queryWrapperForString" resultType="java.lang.String" parameterType="java.lang.String">
34 ${sql} ${ew.customSqlSegment}
35 </select>
36
29 <update id="update"> 37 <update id="update">
30 ${sql} 38 ${sql}
31 </update> 39 </update>
......
...@@ -28,6 +28,10 @@ public interface ICommonSqlService { ...@@ -28,6 +28,10 @@ public interface ICommonSqlService {
28 28
29 List<Map<String, Object>> queryWrapperForList(String sql, QueryWrapper<?> queryWrapper); 29 List<Map<String, Object>> queryWrapperForList(String sql, QueryWrapper<?> queryWrapper);
30 30
31 String queryForString(String sql);
32
33 String queryWrapperForString(String sql, QueryWrapper<?> queryWrapper);
34
31 Integer update(String sql); 35 Integer update(String sql);
32 36
33 Integer updateWrapper(String tableName, UpdateWrapper<?> updateWrapper); 37 Integer updateWrapper(String tableName, UpdateWrapper<?> updateWrapper);
......
...@@ -46,12 +46,23 @@ public class CommonSqlServiceImpl implements ICommonSqlService { ...@@ -46,12 +46,23 @@ public class CommonSqlServiceImpl implements ICommonSqlService {
46 return commonSqlMapper.queryForList(sql); 46 return commonSqlMapper.queryForList(sql);
47 } 47 }
48 48
49
49 @Override 50 @Override
50 public List<Map<String, Object>> queryWrapperForList(String sql, QueryWrapper<?> queryWrapper) { 51 public List<Map<String, Object>> queryWrapperForList(String sql, QueryWrapper<?> queryWrapper) {
51 return commonSqlMapper.queryWrapperForList(sql, queryWrapper); 52 return commonSqlMapper.queryWrapperForList(sql, queryWrapper);
52 } 53 }
53 54
54 @Override 55 @Override
56 public String queryForString(String sql) {
57 return commonSqlMapper.queryForString(sql);
58 }
59
60 @Override
61 public String queryWrapperForString(String sql, QueryWrapper<?> queryWrapper) {
62 return commonSqlMapper.queryWrapperForString(sql, queryWrapper);
63 }
64
65 @Override
55 public Integer update(String sql) { 66 public Integer update(String sql) {
56 return commonSqlMapper.update(sql); 67 return commonSqlMapper.update(sql);
57 } 68 }
......
1 package com.skua.modules.common.vo;
2
3 import com.skua.core.util.DateUtils;
4 import io.swagger.annotations.ApiModelProperty;
5 import lombok.Data;
6 import org.apache.commons.lang3.StringUtils;
7
8 import java.text.ParseException;
9 import java.text.SimpleDateFormat;
10 import java.util.Calendar;
11 import java.util.Date;
12
13 @Data
14 public class DateVO {
15
16 @ApiModelProperty(value = "去年(yyyy)")
17 private int lastYear;
18
19 @ApiModelProperty(value = "去年(yyyy-MM)")
20 private String lastYearMonth;
21 @ApiModelProperty(value = "去年(yyyy-MM-dd)")
22 private String lastYearStartDate;
23 @ApiModelProperty(value = "去年(yyyy-MM-dd)")
24 private String lastYearEndDate;
25
26
27 @ApiModelProperty(value = "上月(yyyy-MM)")
28 private String lastMonth;
29
30 @ApiModelProperty(value = "上月(yyyy-MM-dd)")
31 private String lastMonthDay;
32
33
34 @ApiModelProperty(value = "昨天")
35 private String yesterday;
36
37 @ApiModelProperty(value = "当月(yyyy)")
38 private int nowYear;
39
40 @ApiModelProperty(value = "当月(yyyy-MM)")
41 private String nowMonth;
42
43 @ApiModelProperty(value = "当月(yyyy-MM-dd)")
44 private String nowMonthStartDate;
45
46 @ApiModelProperty(value = "当月(yyyy-MM-dd)")
47 private String nowMonthEndDate;
48
49 @ApiModelProperty(value = "当月(yyyy-MM-dd)")
50 private String nowYearStartDate;
51 @ApiModelProperty(value = "当月(yyyy-MM-dd)")
52 private String nowYearEndDate;
53
54
55 public DateVO(String currentDate) {
56 this.nowMonth = DateUtils.dateformat(currentDate,"yyyy-MM");
57 this.nowMonthStartDate = nowMonth+"-01";
58 this.nowMonthEndDate = nowMonth+"-31";
59
60
61 //this.lastYear = getYear(nowMonth,"yyyy-MM")-1;
62 //this.lastMonth = DateUtils.getLastMonthOfMonth(nowMonth);
63 nowYear = Integer.parseInt( DateUtils.dateformat(currentDate,"yyyy") ) ;
64 nowYearStartDate = nowYear + "-01-01";
65 nowYearEndDate = nowYear + "-12-31";
66 /* this.lastMonthStartTime = lastMonth+"-01";
67 this.lastMonthEndTime = lastMonth+"-31";
68
69 this.lastYearStartTime = lastYear+"-01";
70 this.lastYearEndTime = lastYear +"-31";*/
71 }
72 }
1 package com.skua.tool.util; 1 package com.skua.tool.util;
2 2
3 import com.skua.constant.BaseConstant; 3 import com.skua.constant.BaseConstant;
4
5 import java.math.BigDecimal; 4 import java.math.BigDecimal;
5 import java.text.ParseException;
6 import java.text.ParsePosition; 6 import java.text.ParsePosition;
7 import java.text.SimpleDateFormat; 7 import java.text.SimpleDateFormat;
8 import java.time.DayOfWeek; 8 import java.time.DayOfWeek;
9 import java.time.LocalDate;
10 import java.time.LocalDateTime; 9 import java.time.LocalDateTime;
11 import java.time.YearMonth; 10 import java.time.YearMonth;
12 import java.time.format.DateTimeFormatter; 11 import java.time.format.DateTimeFormatter;
......
...@@ -25,7 +25,9 @@ ...@@ -25,7 +25,9 @@
25 <!-- 校验货号是否唯一 --> 25 <!-- 校验货号是否唯一 -->
26 <select id="checkGoodCodeAndDepartId" resultType="java.lang.Integer"> 26 <select id="checkGoodCodeAndDepartId" resultType="java.lang.Integer">
27 select count(1) from erp_distribut_material 27 select count(1) from erp_distribut_material
28 where good_code = #{goodCode} and depart_id = #{departId} 28 where good_code = #{goodCode}
29 <if test="departId != null and departId !=''">a and depart_id = #{departId}</if>
30
29 </select> 31 </select>
30 32
31 33
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
6 <select id="getListByDistributId" resultType="com.skua.modules.erp.entity.ERPPurchaseContract"> 6 <select id="getListByDistributId" resultType="com.skua.modules.erp.entity.ERPPurchaseContract">
7 select pc.* from erp_purchase_contract pc where pc.id in ( 7 select pc.* from erp_purchase_contract pc where pc.id in (
8 select DISTINCT pm.contract_id from erp_purchase_material pm , erp_distribut_material dm 8 select DISTINCT pm.contract_id from erp_purchase_material pm , erp_distribut_material dm
9 where dm.good_code = dm.good_code and dm.contract_id = '1849328644967497730' 9 where pm.good_code = dm.good_code and dm.contract_id = #{distributContractId}
10 ) 10 )
11 and pc.status = 3 11 and pc.status = 3
12 order by pc.create_time desc 12 order by pc.create_time desc
......
...@@ -13,6 +13,7 @@ import com.skua.modules.erp.service.IDistributContractService; ...@@ -13,6 +13,7 @@ import com.skua.modules.erp.service.IDistributContractService;
13 import com.skua.modules.erp.vo.DistributContractVO; 13 import com.skua.modules.erp.vo.DistributContractVO;
14 import com.skua.modules.erp.vo.PurchasePlanVO; 14 import com.skua.modules.erp.vo.PurchasePlanVO;
15 import com.skua.modules.system.mapper.SysDepartMapper; 15 import com.skua.modules.system.mapper.SysDepartMapper;
16 import org.apache.commons.lang3.StringUtils;
16 import org.springframework.beans.BeanUtils; 17 import org.springframework.beans.BeanUtils;
17 import org.springframework.beans.factory.annotation.Autowired; 18 import org.springframework.beans.factory.annotation.Autowired;
18 import org.springframework.stereotype.Service; 19 import org.springframework.stereotype.Service;
...@@ -47,26 +48,34 @@ public class DistributContractServiceImpl extends ServiceImpl<DistributContractM ...@@ -47,26 +48,34 @@ public class DistributContractServiceImpl extends ServiceImpl<DistributContractM
47 String goodsCode = checkSameGoodCode(distributContractVO.getMaterialList()); 48 String goodsCode = checkSameGoodCode(distributContractVO.getMaterialList());
48 if(goodsCode != null ){ 49 if(goodsCode != null ){
49 errMsg ="操作失败,货号["+ goodsCode +"]重复!"; 50 errMsg ="操作失败,货号["+ goodsCode +"]重复!";
51 return errMsg;
50 } 52 }
51 int count = 0; 53 int count = 0;
52 if(!distributContractVO.getContractCode().equals(oldContractCode)){ 54
55 if(StringUtils.isNotEmpty(oldContractCode)) {
56 if (!oldContractCode.equals(distributContractVO.getContractCode())) {//修改
57 count = this.baseMapper.checkContractCode(distributContractVO.getContractCode() );
58 if(count > 0 ){
59 errMsg = "合同编号["+distributContractVO.getContractCode()+"]重复";
60 }
61 }
62 }else{//新增
53 count = this.baseMapper.checkContractCode(distributContractVO.getContractCode() ); 63 count = this.baseMapper.checkContractCode(distributContractVO.getContractCode() );
54 if(count > checkCount ){ 64 if(count > 0 ){
55 errMsg = "合同编号["+distributContractVO.getContractCode()+"]重复"; 65 errMsg = "合同编号["+distributContractVO.getContractCode()+"]重复";
56 } 66 }
57 } 67 }
58 68
59 if( errMsg == null && distributContractVO.getMaterialList() != null && !distributContractVO.getMaterialList().isEmpty()){ 69 if( distributContractVO.getMaterialList() != null && !distributContractVO.getMaterialList().isEmpty()){
60 for(DistributMaterial material : distributContractVO.getMaterialList()){ 70 for(DistributMaterial material : distributContractVO.getMaterialList()){
61 //根据deptid与goodscode校验 71 //根据deptid与goodscode校验
62 count = checkGoodCodeAndDepartId( material.getGoodCode(),distributContractVO.getDepartId() ); 72 count = checkGoodCodeAndDepartId( material.getGoodCode(),null );
63 if(count > 0 ){ 73 if(count > checkCount ){
64 errMsg = "所属厂站["+departMapper.selectById(distributContractVO.getDepartId()).getDepartName()+"]下的货号["+material.getGoodCode()+"]已经分销过!"; 74 errMsg = "所属厂站["+departMapper.selectById(distributContractVO.getDepartId()).getDepartName()+"]下的货号["+material.getGoodCode()+"]已经分销过!";
65 break; 75 break;
66 } 76 }
67 } 77 }
68 } 78 }
69
70 return errMsg; 79 return errMsg;
71 } 80 }
72 81
......
...@@ -51,17 +51,25 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr ...@@ -51,17 +51,25 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
51 String result = null; 51 String result = null;
52 int count = 0; 52 int count = 0;
53 53
54 if(!purchaseContractVO.getContractCode().equals(oldContractCode)){ 54 if(StringUtils.isNotEmpty(oldContractCode)){
55 if( ! oldContractCode.equals( purchaseContractVO.getContractCode() )){
56 count = purchaseMaterialMapper.checkContractCode(purchaseContractVO.getContractCode() );
57 if(count > 0 ){
58 result = "合同编号["+purchaseContractVO.getContractCode()+"]重复";
59 return result;
60 }
61 }
62 }else{
55 count = purchaseMaterialMapper.checkContractCode(purchaseContractVO.getContractCode() ); 63 count = purchaseMaterialMapper.checkContractCode(purchaseContractVO.getContractCode() );
56 if(count > checkCount ){ 64 if(count > 0 ){
57 result = "合同编号["+purchaseContractVO.getContractCode()+"]重复"; 65 result = "合同编号["+purchaseContractVO.getContractCode()+"]重复";
66 return result;
58 } 67 }
59 } 68 }
60 69 if( purchaseContractVO.getMaterialList()!= null && !purchaseContractVO.getMaterialList().isEmpty()){
61 if( result == null && purchaseContractVO.getMaterialList()!= null && !purchaseContractVO.getMaterialList().isEmpty()){
62 for(PurchaseMaterial purchaseMaterial : purchaseContractVO.getMaterialList()){ 70 for(PurchaseMaterial purchaseMaterial : purchaseContractVO.getMaterialList()){
63 if(StringUtils.isNotEmpty(purchaseMaterial.getGoodCode())){ 71 if(StringUtils.isNotEmpty(purchaseMaterial.getGoodCode())){
64 count = purchaseMaterialMapper.checkGoodCode(purchaseMaterial.getId(),purchaseMaterial.getGoodCode()); 72 count = purchaseMaterialMapper.checkGoodCode(null,purchaseMaterial.getGoodCode());
65 if(count > checkCount ){ 73 if(count > checkCount ){
66 result = "校验失败,货号[ "+purchaseMaterial.getGoodCode()+" ]已经存在!" ; 74 result = "校验失败,货号[ "+purchaseMaterial.getGoodCode()+" ]已经存在!" ;
67 break; 75 break;
......
...@@ -152,6 +152,7 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia ...@@ -152,6 +152,7 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia
152 equipmentOutDTO.setUseBy( BaseContextHandler.getUserId() );//使用人 152 equipmentOutDTO.setUseBy( BaseContextHandler.getUserId() );//使用人
153 equipmentOutDTO.setOutDate( BaseUtil.getCurrentDate() ); 153 equipmentOutDTO.setOutDate( BaseUtil.getCurrentDate() );
154 equipmentOutDTO.setInventoryUpdateTimeEnd( BaseUtil.getCurrentDate()); 154 equipmentOutDTO.setInventoryUpdateTimeEnd( BaseUtil.getCurrentDate());
155
155 equipmentOutDTO.setSuppliesWarehouseId( equipmentIn.getSuppliesWarehouseId() );// this.suppliesWarehouseId = suppliesWarehouseId;//所属仓库 156 equipmentOutDTO.setSuppliesWarehouseId( equipmentIn.getSuppliesWarehouseId() );// this.suppliesWarehouseId = suppliesWarehouseId;//所属仓库
156 //this.outOrder = outOrder; 157 //this.outOrder = outOrder;
157 // this.recipient = recipient;//领用人 158 // this.recipient = recipient;//领用人
...@@ -180,6 +181,7 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia ...@@ -180,6 +181,7 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia
180 } 181 }
181 }catch(ServiceException e){ 182 }catch(ServiceException e){
182 e.printStackTrace(); 183 e.printStackTrace();
184 throw new ServiceException("入库失败:"+e.getMessage());
183 } 185 }
184 //equipmentOutService.saveEquipmentOut(equipmentOutDTO); 186 //equipmentOutService.saveEquipmentOut(equipmentOutDTO);
185 return errMsg; 187 return errMsg;
...@@ -200,7 +202,7 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia ...@@ -200,7 +202,7 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia
200 202
201 equipmentInDTO.setSuppliesWarehouseId( inWarehouseId ) ;//入库仓库 203 equipmentInDTO.setSuppliesWarehouseId( inWarehouseId ) ;//入库仓库
202 equipmentInDTO.setInDate( DateUtil.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss")); 204 equipmentInDTO.setInDate( DateUtil.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss"));
203 equipmentInDTO.setUseBy( BaseContextHandler.getUserId() ) ;//经办人 205 equipmentInDTO.setUseBy( materialINVO.getReceiver() ) ;//经办人(收货人)
204 equipmentInDTO.setChooseTime( DateUtil.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss") );//经办时间 206 equipmentInDTO.setChooseTime( DateUtil.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss") );//经办时间
205 equipmentInDTO.setRemark( materialINVO.getRemark() );//备注 207 equipmentInDTO.setRemark( materialINVO.getRemark() );//备注
206 208
......
...@@ -310,4 +310,41 @@ public class DateUtil { ...@@ -310,4 +310,41 @@ public class DateUtil {
310 } 310 }
311 return date; 311 return date;
312 } 312 }
313
314
315 /**
316 * 格式化
317 * @param date
318 * @param format
319 * @return
320 */
321 public static String dateformat(String date, String format) {
322 SimpleDateFormat sformat = new SimpleDateFormat(format);
323 Date _date = null;
324 try {
325 _date = sformat.parse(date);
326 } catch (ParseException var5) {
327 var5.printStackTrace();
328 }
329 return sformat.format(_date);
330 }
331
332 /***
333 * 两个时间差
334 * @param date1
335 * @param date2
336 * @return
337 */
338 public static int differenceTime(String date1,String date2){
339 int daysDifference = 1;
340 try{
341 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
342 // 计算两个日期之间的差值
343 daysDifference = org.apache.commons.lang3.time.DateUtils.toCalendar( sdf.parse(date2)).get(Calendar.DAY_OF_YEAR)
344 - org.apache.commons.lang3.time.DateUtils.toCalendar( sdf.parse(date1)).get(Calendar.DAY_OF_YEAR); // 直接计算天数差值
345 }catch(Exception e){
346 e.printStackTrace();
347 }
348 return daysDifference;
349 }
313 } 350 }
......
...@@ -14,6 +14,17 @@ import java.util.regex.Matcher; ...@@ -14,6 +14,17 @@ import java.util.regex.Matcher;
14 import java.util.regex.Pattern; 14 import java.util.regex.Pattern;
15 15
16 public class BaseUtil { 16 public class BaseUtil {
17
18 public static String dateformat(String date, String format) {
19 SimpleDateFormat sformat = new SimpleDateFormat(format);
20 Date _date = null;
21 try {
22 _date = sformat.parse(date);
23 } catch (ParseException var5) {
24 var5.printStackTrace();
25 }
26 return sformat.format(_date);
27 }
17 /** 28 /**
18 * 保留两位小数方法 29 * 保留两位小数方法
19 * 30 *
...@@ -419,6 +430,8 @@ public class BaseUtil { ...@@ -419,6 +430,8 @@ public class BaseUtil {
419 return calendar.get(Calendar.SECOND); 430 return calendar.get(Calendar.SECOND);
420 } 431 }
421 432
433
434
422 /** 435 /**
423 * 过滤html标签 436 * 过滤html标签
424 * @param htmlStr 437 * @param htmlStr
......
...@@ -23,12 +23,12 @@ public class JTDisplayScreenController { ...@@ -23,12 +23,12 @@ public class JTDisplayScreenController {
23 @Autowired 23 @Autowired
24 private IJTDisplayScreenService displayScreenService ; 24 private IJTDisplayScreenService displayScreenService ;
25 25
26 @AutoLog(value = "厂站记录") 26 @AutoLog(value = "厂站地图列表")
27 @ApiOperation(value = "厂长列表", notes = "厂长列表") 27 @ApiOperation(value = "厂长地图列表", notes = "厂长地图列表")
28 @GetMapping(value = "/factoryList") 28 @GetMapping(value = "/factoryList")
29 public Result<List<SysFactoryInfoVO>> factoryList(String time) { 29 public Result<List<SysFactoryInfoVO>> factoryList() {
30 Result<List<SysFactoryInfoVO>> result = new Result<>(); 30 Result<List<SysFactoryInfoVO>> result = new Result<>();
31 List<SysFactoryInfoVO> list = displayScreenService.getFactoryList(time); 31 List<SysFactoryInfoVO> list = displayScreenService.getFactoryList();
32 result.setResult(list); 32 result.setResult(list);
33 return result; 33 return result;
34 } 34 }
......
1 package com.skua.modules.threedimensional.service; 1 package com.skua.modules.threedimensional.service;
2 2
3 import com.skua.modules.threedimensional.vo.ProjectOperationInfoVO;
3 import com.skua.modules.threedimensional.vo.SysFactoryInfoVO; 4 import com.skua.modules.threedimensional.vo.SysFactoryInfoVO;
4 import java.util.List; 5 import java.util.List;
5 6
7 /**
8 * 对外展示集团大屏
9 */
6 public interface IJTDisplayScreenService { 10 public interface IJTDisplayScreenService {
7 11
8 /*** 12 /***
9 * 厂站列表 13 * 厂站列表 以及出水量统计
10 * @param time
11 * @return 14 * @return
12 */ 15 */
13 List<SysFactoryInfoVO> getFactoryList(String time ); 16 List<SysFactoryInfoVO> getFactoryList( );
17
18 /**
19 *对外展示集团大屏 : 项目运营情况
20 * @return
21 */
22 ProjectOperationInfoVO getProjectOperationInfo();
14 } 23 }
......
...@@ -2,13 +2,25 @@ package com.skua.modules.threedimensional.service.impl; ...@@ -2,13 +2,25 @@ package com.skua.modules.threedimensional.service.impl;
2 2
3 import com.skua.common.report.ReportViewUtil; 3 import com.skua.common.report.ReportViewUtil;
4 import com.skua.core.context.SpringContextUtils; 4 import com.skua.core.context.SpringContextUtils;
5 import com.skua.core.util.ConvertUtils;
5 import com.skua.core.util.DateUtils; 6 import com.skua.core.util.DateUtils;
7 import com.skua.modules.common.mapper.CommonSqlMapper;
8 import com.skua.modules.common.service.ICommonSqlService;
9 import com.skua.modules.common.vo.DateVO;
10 import com.skua.modules.guest.util.DateUtil;
6 import com.skua.modules.threedimensional.service.IJTDisplayScreenService; 11 import com.skua.modules.threedimensional.service.IJTDisplayScreenService;
12 import com.skua.modules.threedimensional.vo.ProjectOperationInfoVO;
7 import com.skua.modules.threedimensional.vo.SysFactoryInfoVO; 13 import com.skua.modules.threedimensional.vo.SysFactoryInfoVO;
14 import com.skua.tool.util.DigitalUtils;
15 import io.swagger.annotations.ApiModelProperty;
16 import org.springframework.beans.factory.annotation.Autowired;
8 import org.springframework.jdbc.core.JdbcTemplate; 17 import org.springframework.jdbc.core.JdbcTemplate;
9 import org.springframework.stereotype.Service; 18 import org.springframework.stereotype.Service;
10 19
20 import java.util.ArrayList;
21 import java.util.HashMap;
11 import java.util.List; 22 import java.util.List;
23 import java.util.Map;
12 24
13 25
14 /** 26 /**
...@@ -16,32 +28,83 @@ import java.util.List; ...@@ -16,32 +28,83 @@ import java.util.List;
16 */ 28 */
17 @Service 29 @Service
18 public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService { 30 public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
31
32 @Autowired
33 private ICommonSqlService commonSqlService;
34
19 private static String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1"; 35 private static String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";
20 /*** 36 /***
21 * 37 *厂站列表 以及出水量统计
22 * @return 38 * @return
23 */ 39 */
24 public List<SysFactoryInfoVO> getFactoryList(String time ){ 40 public List<SysFactoryInfoVO> getFactoryList( ){
25 List<SysFactoryInfoVO> factoryInfoVOList = null; 41 List<SysFactoryInfoVO> factoryInfoVOList = null;
26 String startDate = time+"-01"; 42 Map<String, SysFactoryInfoVO> factoryInfoMap = new HashMap<>();
27 String endDate = time+"-31";; 43 SysFactoryInfoVO factoryInfoVO = null;
28 String departId = null;
29 44
30 String yesterday = DateUtils.getYesterday(); 45 String lastDay = DateUtils.getLastDay();//昨天
46 String currentDate = DateUtil.getCurrentDate();//今天
47 DateVO dateVO = new DateVO( DateUtil.getCurrentDate() );
48 //时间差
49 int differenceTime = DateUtil.differenceTime( dateVO.getNowYearStartDate(),currentDate);
50 //主库数据源
51 JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
31 52
32 // 53 String factorySql = "select fi.id,fi.depart_id,d.depart_name, fi.pro_longitude,fi.pro_latitude from sys_factory_info fi ,sys_depart d where fi.depart_id = d.id and d.depart_type =1";
54 List<Map<String, Object>> dataList = masterDB.queryForList(factorySql);
55 for(Map<String, Object> dataMap : dataList) {
56 // resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("create_by"))+""+ConvertUtils.getString(dataMap.get("title")));
57 factoryInfoVO = new SysFactoryInfoVO(dataMap.get("id")+"",dataMap.get("depart_id").toString(),dataMap.get("depart_name").toString(),dataMap.get("pro_longitude").toString(),dataMap.get("pro_latitude").toString());
58 factoryInfoMap.put(factoryInfoVO.getDepartId(),factoryInfoVO);
59 }
60 //查询部门集合
33 String departIdSql ="select GROUP_CONCAT(fi.depart_id ) from sys_factory_info fi ,sys_depart d where fi.depart_id = d.id and d.depart_type =1 "; 61 String departIdSql ="select GROUP_CONCAT(fi.depart_id ) from sys_factory_info fi ,sys_depart d where fi.depart_id = d.id and d.depart_type =1 ";
34 String departIds = null; 62 String departIds = masterDB.queryForObject( departIdSql,String.class);
35 String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departIds, startDate, endDate);
36 System.out.println("********************************************");
37 System.out.println(dataViewName2119);
38 63
39 //主库数据源 64 //昨天处理水量(m³)
40 JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master"); 65 String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departIds, lastDay, lastDay);//depart_id CSL
66 dataList = masterDB.queryForList(dataViewName2119);
67 for(Map<String, Object> dataMap : dataList) {
68 factoryInfoVO = factoryInfoMap.get(dataMap.get("depart_id").toString());
69 if(factoryInfoVO != null ) factoryInfoVO.setCsl_lastDay(dataMap.get("CSL").toString() ) ;
70 // resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("create_by"))+""+ConvertUtils.getString(dataMap.get("title")));
71 }
72 //本月处理水量(m³)
73 dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departIds, dateVO.getNowMonthStartDate(), dateVO.getNowMonthEndDate());
74 dataList = masterDB.queryForList(dataViewName2119);
75 for(Map<String, Object> dataMap : dataList) {
76 factoryInfoVO = factoryInfoMap.get(dataMap.get("depart_id").toString());
77 if(factoryInfoVO != null ) factoryInfoVO.setCsl_month(dataMap.get("CSL").toString() ) ;
78 // resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("create_by"))+""+ConvertUtils.getString(dataMap.get("title")));
79 }
80 //本年处理水量(万m³)
81 dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departIds, dateVO.getNowYearStartDate(), currentDate);
82 dataList = masterDB.queryForList(dataViewName2119);
83 for(Map<String, Object> dataMap : dataList) {
84 factoryInfoVO = factoryInfoMap.get(dataMap.get("depart_id").toString());
85 if(factoryInfoVO != null ){
86 factoryInfoVO.setCsl_year(dataMap.get("CSL").toString() ) ;
87 factoryInfoVO.setCsl_avg_day(DigitalUtils.division( dataMap.get("CSL").toString() ,differenceTime+"" ) );
88 }
89 // resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("create_by"))+""+ConvertUtils.getString(dataMap.get("title")));
90 }
91 factoryInfoVOList = new ArrayList(factoryInfoMap.values());
92 return factoryInfoVOList;
93 }
41 94
42 String sql = "select " + " sum(v1.CSL)/10000 " + " from "+dataViewName2119+" v1 " ;
43 95
96 /**
97 *对外展示集团大屏 : 项目运营情况
98 * @return
99 */
100 public ProjectOperationInfoVO getProjectOperationInfo(){
101 ProjectOperationInfoVO projectOperationInfoVO = new ProjectOperationInfoVO();
44 102
45 return factoryInfoVOList; 103
104
105
106
107 return projectOperationInfoVO;
46 } 108 }
109
47 } 110 }
......
1 package com.skua.modules.threedimensional.vo;
2
3 import io.swagger.annotations.ApiModel;
4 import io.swagger.annotations.ApiModelProperty;
5 import lombok.Data;
6
7 /**
8 * 对外展示集团大屏
9 */
10 @Data
11 @ApiModel(value="对外展示集团大屏:项目运营情况", description="对外展示集团大屏:项目运营情况")
12 public class ProjectOperationInfoVO {
13 @ApiModelProperty(value = "水厂数")
14 private String departCount;
15
16 @ApiModelProperty(value = "污水处理能力")
17 private String wsclnl;
18
19 @ApiModelProperty(value = "月产水量")
20 private String ycsl;
21
22 @ApiModelProperty(value = "水质综合达标率")
23 private String szzhdbl;
24
25 @ApiModelProperty(value = "运行负荷率")
26 private String yxfhl;
27
28 @ApiModelProperty(value = "污泥含水率")
29 private String wnhsl;
30 }
...@@ -15,6 +15,9 @@ public class SysFactoryInfoVO { ...@@ -15,6 +15,9 @@ public class SysFactoryInfoVO {
15 private String id; 15 private String id;
16 16
17 @ApiModelProperty(value = "水厂名称") 17 @ApiModelProperty(value = "水厂名称")
18 private String departId;
19
20 @ApiModelProperty(value = "水厂名称")
18 private String departName; 21 private String departName;
19 22
20 @ApiModelProperty(value = "经度") 23 @ApiModelProperty(value = "经度")
...@@ -35,4 +38,15 @@ public class SysFactoryInfoVO { ...@@ -35,4 +38,15 @@ public class SysFactoryInfoVO {
35 @ApiModelProperty(value = "本年处理水量") 38 @ApiModelProperty(value = "本年处理水量")
36 private String csl_year; 39 private String csl_year;
37 40
41
42 public SysFactoryInfoVO() {
43 }
44
45 public SysFactoryInfoVO(String id, String departId, String departName, String proLongitude, String proLatitude) {
46 this.id = id;
47 this.departId = departId;
48 this.departName = departName;
49 this.proLongitude = proLongitude;
50 this.proLatitude = proLatitude;
51 }
38 } 52 }
......
...@@ -48,7 +48,7 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { ...@@ -48,7 +48,7 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService {
48 List<WaterQualityMonitoringDetailVO> list = new ArrayList<>(); 48 List<WaterQualityMonitoringDetailVO> list = new ArrayList<>();
49 Map<String, Object> monitorTagMap = new HashMap<String,Object>(); 49 Map<String, Object> monitorTagMap = new HashMap<String,Object>();
50 QueryWrapper<SysMonitorMetricInfo> qw = new QueryWrapper<>(); 50 QueryWrapper<SysMonitorMetricInfo> qw = new QueryWrapper<>();
51 qw.in("metric_uid_tag", "JSTP,JSTN,JSPH,JSNH3N,JSCOD,CSTP,CSTN,CSPH,CSNH3N,CSCOD".split(",")); 51 qw.in("metric_uid_tag", "JSTP,JSTN,JSPH,JSNH3N,JSCOD,CSTP,CSTN,CSPH,CSNH3N,CSCOD".split(",")); //CSLL 出水瞬时流量() CSLJLL出水流量累计JSLL(JSLJLL) JSSS 进水浊度 CSSS 出水浊度
52 qw.eq("depart_id", departId); 52 qw.eq("depart_id", departId);
53 qw.groupBy("depart_id","metric_uid_tag"); 53 qw.groupBy("depart_id","metric_uid_tag");
54 List<SysMonitorMetricInfo> monitorList = sysMonitorMetricInfoService.list(qw); 54 List<SysMonitorMetricInfo> monitorList = sysMonitorMetricInfoService.list(qw);
......
...@@ -49,7 +49,5 @@ public class DataVO { ...@@ -49,7 +49,5 @@ public class DataVO {
49 49
50 this.lastYearStartTime = lastYear+"-01"; 50 this.lastYearStartTime = lastYear+"-01";
51 this.lastYearEndTime = lastYear +"-31"; 51 this.lastYearEndTime = lastYear +"-31";
52
53
54 } 52 }
55 } 53 }
......
...@@ -77,7 +77,6 @@ public class EquipmentInServiceImpl extends ServiceImpl<EquipmentInMapper, Equip ...@@ -77,7 +77,6 @@ public class EquipmentInServiceImpl extends ServiceImpl<EquipmentInMapper, Equip
77 public int saveEquipmentIn(EquipmentInDTO equipmentInDTO) throws Exception { 77 public int saveEquipmentIn(EquipmentInDTO equipmentInDTO) throws Exception {
78 List<SuppliesWarehouse> suppliesWarehouseList = suppliesWarehouseService.list();//供应商列表 78 List<SuppliesWarehouse> suppliesWarehouseList = suppliesWarehouseService.list();//供应商列表
79 Map<String, String> warehouseDictMap = suppliesWarehouseList.stream().collect(Collectors.toMap(SuppliesWarehouse::getId, SuppliesWarehouse::getDepartId)); 79 Map<String, String> warehouseDictMap = suppliesWarehouseList.stream().collect(Collectors.toMap(SuppliesWarehouse::getId, SuppliesWarehouse::getDepartId));
80
81 if (equipmentInDTO.getEquipmentInChildList() == null || equipmentInDTO.getEquipmentInChildList().isEmpty()) { 80 if (equipmentInDTO.getEquipmentInChildList() == null || equipmentInDTO.getEquipmentInChildList().isEmpty()) {
82 throw new JeecgBootException("请选择入库备件!"); 81 throw new JeecgBootException("请选择入库备件!");
83 } 82 }
...@@ -102,7 +101,7 @@ public class EquipmentInServiceImpl extends ServiceImpl<EquipmentInMapper, Equip ...@@ -102,7 +101,7 @@ public class EquipmentInServiceImpl extends ServiceImpl<EquipmentInMapper, Equip
102 this.baseMapper.insert(equipmentIn); 101 this.baseMapper.insert(equipmentIn);
103 return 1; 102 return 1;
104 })); 103 }));
105 CountDownLatch countDownLatch = new CountDownLatch(equipmentInDTO.getEquipmentInChildList().size()); 104 // CountDownLatch countDownLatch = new CountDownLatch(equipmentInDTO.getEquipmentInChildList().size());
106 /* //如果是采购入库 105 /* //如果是采购入库
107 Map<String, PurchaseInfoDetail> purchaseMap = Maps.newHashMap(); 106 Map<String, PurchaseInfoDetail> purchaseMap = Maps.newHashMap();
108 if ("cg".equals(equipmentInDTO.getInType()) && StringUtils.isNotEmpty(equipmentInDTO.getPurchaseCode())) { 107 if ("cg".equals(equipmentInDTO.getInType()) && StringUtils.isNotEmpty(equipmentInDTO.getPurchaseCode())) {
...@@ -116,7 +115,6 @@ public class EquipmentInServiceImpl extends ServiceImpl<EquipmentInMapper, Equip ...@@ -116,7 +115,6 @@ public class EquipmentInServiceImpl extends ServiceImpl<EquipmentInMapper, Equip
116 for (EquipmentInChild equipmentInChild : equipmentInDTO.getEquipmentInChildList()) { 115 for (EquipmentInChild equipmentInChild : equipmentInDTO.getEquipmentInChildList()) {
117 equipmentInChild.setInId(inId); 116 equipmentInChild.setInId(inId);
118 // taskExecutor.execute(() -> { 117 // taskExecutor.execute(() -> {
119 try {
120 String sparepartId = equipmentInChild.getSparepartId(); 118 String sparepartId = equipmentInChild.getSparepartId();
121 String suppliesWarehouseId = equipmentInDTO.getSuppliesWarehouseId(); 119 String suppliesWarehouseId = equipmentInDTO.getSuppliesWarehouseId();
122 //根据物资id和仓库id获取库存 120 //根据物资id和仓库id获取库存
...@@ -167,15 +165,10 @@ public class EquipmentInServiceImpl extends ServiceImpl<EquipmentInMapper, Equip ...@@ -167,15 +165,10 @@ public class EquipmentInServiceImpl extends ServiceImpl<EquipmentInMapper, Equip
167 //============= 165 //=============
168 return 1; 166 return 1;
169 }); 167 });
170 } catch (Exception e1) { 168
171 e1.printStackTrace();
172 // log.error("异常error: {}", e1.getMessage());
173 } finally {
174 countDownLatch.countDown();
175 }
176 // }); 169 // });
177 } 170 }
178 countDownLatch.await(); 171 //countDownLatch.await();
179 return 1; 172 return 1;
180 } 173 }
181 174
......
...@@ -61,26 +61,27 @@ public class EquipmentOutServiceImpl extends ServiceImpl<EquipmentOutMapper, Equ ...@@ -61,26 +61,27 @@ public class EquipmentOutServiceImpl extends ServiceImpl<EquipmentOutMapper, Equ
61 @Transactional 61 @Transactional
62 public String saveEquipmentOut(EquipmentOutDTO equipmentOutDTO) throws Exception { 62 public String saveEquipmentOut(EquipmentOutDTO equipmentOutDTO) throws Exception {
63 String errMsg = null; 63 String errMsg = null;
64 if (equipmentOutDTO.getEquipmentOutChildList() == null || equipmentOutDTO.getEquipmentOutChildList().isEmpty()) { 64 try{
65 errMsg = "请选择出库备件"; 65 if (equipmentOutDTO.getEquipmentOutChildList() == null || equipmentOutDTO.getEquipmentOutChildList().isEmpty()) {
66 return errMsg; 66 errMsg = "请选择出库备件";
67 } 67 return errMsg;
68 // 出库单号 68 }
69 if (StringUtils.isEmpty(equipmentOutDTO.getOutOrder())) { 69 // 出库单号
70 String outOrder = "CK-" + DateUtils.format(new Date(), "YYYYMMdd" + "-" + System.currentTimeMillis()); 70 if (StringUtils.isEmpty(equipmentOutDTO.getOutOrder())) {
71 equipmentOutDTO.setOutOrder(outOrder); 71 String outOrder = "CK-" + DateUtils.format(new Date(), "YYYYMMdd" + "-" + System.currentTimeMillis());
72 } 72 equipmentOutDTO.setOutOrder(outOrder);
73 // 出库表主键 73 }
74 String outId = UUID.randomUUID().toString().replaceAll("-", ""); 74 // 出库表主键
75 equipmentOutDTO.setId(outId); 75 String outId = UUID.randomUUID().toString().replaceAll("-", "");
76 EquipmentOut equipmentOut = BeanExtUtils.bean2Bean(equipmentOutDTO, EquipmentOut.class); 76 equipmentOutDTO.setId(outId);
77 equipmentOut.setInventoryUpdateTime(new Date()); 77 EquipmentOut equipmentOut = BeanExtUtils.bean2Bean(equipmentOutDTO, EquipmentOut.class);
78 this.baseMapper.insert(equipmentOut); 78 equipmentOut.setInventoryUpdateTime(new Date());
79 // CountDownLatch countDownLatch = new CountDownLatch(equipmentOutDTO.getEquipmentOutChildList().size()); 79 this.baseMapper.insert(equipmentOut);
80 for (EquipmentOutChild equipmentOutChild : equipmentOutDTO.getEquipmentOutChildList()) { 80 // CountDownLatch countDownLatch = new CountDownLatch(equipmentOutDTO.getEquipmentOutChildList().size());
81 equipmentOutChild.setId(UniqIdUtils.getInstance().getUniqID()); 81 for (EquipmentOutChild equipmentOutChild : equipmentOutDTO.getEquipmentOutChildList()) {
82 equipmentOutChild.setOutId(outId); 82 equipmentOutChild.setId(UniqIdUtils.getInstance().getUniqID());
83 // taskExecutor.execute(() -> { 83 equipmentOutChild.setOutId(outId);
84 // taskExecutor.execute(() -> {
84 String sparepartId = equipmentOutChild.getSparepartId(); 85 String sparepartId = equipmentOutChild.getSparepartId();
85 String suppliesWarehouseId = equipmentOutDTO.getSuppliesWarehouseId(); 86 String suppliesWarehouseId = equipmentOutDTO.getSuppliesWarehouseId();
86 87
...@@ -92,7 +93,10 @@ public class EquipmentOutServiceImpl extends ServiceImpl<EquipmentOutMapper, Equ ...@@ -92,7 +93,10 @@ public class EquipmentOutServiceImpl extends ServiceImpl<EquipmentOutMapper, Equ
92 //物料信息 93 //物料信息
93 EquipmentSparepartSupplies supplies = sparepartSuppliesService.getById(sparepartId); 94 EquipmentSparepartSupplies supplies = sparepartSuppliesService.getById(sparepartId);
94 equipmentSparepart = new EquipmentSparepart(); 95 equipmentSparepart = new EquipmentSparepart();
95 BeanUtils.copyProperties(supplies, equipmentSparepart); 96 if(supplies != null ){
97 BeanUtils.copyProperties(supplies, equipmentSparepart);
98 }
99
96 equipmentSparepart.setId(null); 100 equipmentSparepart.setId(null);
97 equipmentSparepart.setStorageNum(BigDecimal.ZERO); 101 equipmentSparepart.setStorageNum(BigDecimal.ZERO);
98 equipmentSparepart.setSuppliesId(sparepartId); 102 equipmentSparepart.setSuppliesId(sparepartId);
...@@ -118,9 +122,14 @@ public class EquipmentOutServiceImpl extends ServiceImpl<EquipmentOutMapper, Equ ...@@ -118,9 +122,14 @@ public class EquipmentOutServiceImpl extends ServiceImpl<EquipmentOutMapper, Equ
118 return 0; 122 return 0;
119 } 123 }
120 }); 124 });
121 // }); 125 // });
126 }
127 // countDownLatch.await();
128 }catch (Exception e){
129 e.printStackTrace();
130 throw new Exception("出库失败:"+e.getMessage());
122 } 131 }
123 // countDownLatch.await(); 132
124 return errMsg ; 133 return errMsg ;
125 } 134 }
126 } 135 }
......
1 package com.skua.modules.equipment.vo;
2
3 import io.swagger.annotations.ApiModel;
4 import io.swagger.annotations.ApiModelProperty;
5 import lombok.Data;
6
7 /**
8 * @auther kangwei
9 * @create 2024-10-25-9:30
10 */
11 @Data
12 @ApiModel
13 public class DrugConsumptionVO {
14
15 @ApiModelProperty(value = "总药耗")
16 private String zyh;
17
18 @ApiModelProperty(value = "同比去年总药耗")
19 private String tbqnzyh;
20
21 @ApiModelProperty(value = "同比去年总药耗")
22 private String tbqnzyhsl;
23
24 @ApiModelProperty(value = "同比去年总药耗")
25 private String tbqnzyhbl;
26
27 @ApiModelProperty(value = "环比上月总药耗")
28 private String hbsyzyh;
29
30 @ApiModelProperty(value = "环比上月总药耗")
31 private String hbsyzyhsl;
32
33 @ApiModelProperty(value = "环比上月总药耗")
34 private String hbsyzyhbl;
35
36 @ApiModelProperty(value = "目标吨水药耗")
37 private String dsyh;
38
39
40
41 @ApiModelProperty(value = "tbqndsyhsl")
42 private String tbqndsyhsl;
43
44 @ApiModelProperty(value = "tbqndsyhbl")
45 private String tbqndsyhbl;
46
47 }
...@@ -94,7 +94,8 @@ public class MybatisInterceptor implements Interceptor { ...@@ -94,7 +94,8 @@ public class MybatisInterceptor implements Interceptor {
94 add("erp_distribut_material"); 94 add("erp_distribut_material");
95 //共享风险库 95 //共享风险库
96 add("danger_level_manage_share"); 96 add("danger_level_manage_share");
97 97 // 库存表
98 add("equipment_sparepart");
98 }}; 99 }};
99 100
100 //过滤不需要走部门ID查询的URL 101 //过滤不需要走部门ID查询的URL
...@@ -154,6 +155,8 @@ public class MybatisInterceptor implements Interceptor { ...@@ -154,6 +155,8 @@ public class MybatisInterceptor implements Interceptor {
154 || "com.skua.modules.erp.mapper.DistributContractMapper.selectList".equals(sqlId) //分销合同列表 155 || "com.skua.modules.erp.mapper.DistributContractMapper.selectList".equals(sqlId) //分销合同列表
155 || "com.skua.modules.erp.mapper.ERPPurchaseContractMapper.getListByDistributId".equals(sqlId) 156 || "com.skua.modules.erp.mapper.ERPPurchaseContractMapper.getListByDistributId".equals(sqlId)
156 || "com.skua.modules.system.datestandard.mapper.SysMonitorMetricInfoMapper.selectList".equals(sqlId) //点表 157 || "com.skua.modules.system.datestandard.mapper.SysMonitorMetricInfoMapper.selectList".equals(sqlId) //点表
158 || "com.skua.modules.equipment.mapper.EquipmentSparepartMapper.selectOne".equals(sqlId)
159 || "com.skua.modules.supplies.mapper.EquipmentSparepartSuppliesMapper.selectById".equals(sqlId)
157 ) { 160 ) {
158 log.debug("************************------sqlId------**************************" + sqlId); 161 log.debug("************************------sqlId------**************************" + sqlId);
159 return invocation.proceed(); 162 return invocation.proceed();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!