forked from I3-YF/i3plus-mes-pcn-yfai
				
			44509 需要边端开发和零件条码状态相关的报表,用来展示未知条码 merge uat-temp-castle-2412301006-44509 解决冲突
						commit
						4b310004a6
					
				| @ -0,0 +1,12 @@ | ||||
| package cn.estsh.i3plus.ext.mes.pcn.api.base; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| 
 | ||||
| import java.util.Map; | ||||
| 
 | ||||
| public interface IMesEnumExtService { | ||||
| 
 | ||||
|     @ApiOperation("根据枚举名获取枚举") | ||||
|     Map<String, Object> doGetMesEnumByEnumName(String organizeCode, String enumName); | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,22 @@ | ||||
| package cn.estsh.i3plus.ext.mes.pcn.api.report; | ||||
| 
 | ||||
| 
 | ||||
| import cn.estsh.i3plus.pojo.base.bean.ListPager; | ||||
| import cn.estsh.i3plus.pojo.base.common.Pager; | ||||
| import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| 
 | ||||
| /** | ||||
|  * @Description : 报表-业务方法 | ||||
|  * @Reference : | ||||
|  * @Author : logic | ||||
|  * @CreateDate : 2024/6/15 11:30 | ||||
|  * @Modify: | ||||
|  **/ | ||||
| public interface IMesYfReportService { | ||||
| 
 | ||||
|     @ApiOperation("零件条码状态查询") | ||||
|     ListPager<MesProduceSn> queryMesProduceSn(MesProduceSn mesProduceSn, Pager pager); | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,45 @@ | ||||
| package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.base; | ||||
| 
 | ||||
| 
 | ||||
| import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesEnumExtService; | ||||
| import cn.estsh.i3plus.mes.pcn.util.EnumUtil; | ||||
| import cn.estsh.i3plus.pojo.base.enumutil.MesEnumUtil; | ||||
| import cn.estsh.i3plus.pojo.mes.dbinterface.MesInterfaceEnumUtil; | ||||
| import cn.estsh.i3plus.pojo.mes.repository.MesEnumDetailRepository; | ||||
| import cn.estsh.i3plus.pojo.mes.repository.MesEnumRepository; | ||||
| import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.util.CollectionUtils; | ||||
| 
 | ||||
| import java.util.Map; | ||||
| 
 | ||||
| /** | ||||
|  * @Author: Wynne.Lu | ||||
|  * @CreateDate: 2019/8/30 1:39 PM | ||||
|  * @Description: | ||||
|  **/ | ||||
| @Slf4j | ||||
| @Service | ||||
| @ApiOperation(value = "获取MesEnumUtil") | ||||
| public class MesEnumExtService implements IMesEnumExtService { | ||||
| 
 | ||||
|     @Override | ||||
|     public Map<String, Object> doGetMesEnumByEnumName(String organizeCode, String enumName) { | ||||
|         Map<String, Object> enumMap; | ||||
|         enumMap = getEnumByClazzEnum(enumName, MesExtEnumUtil.class); | ||||
|         if (CollectionUtils.isEmpty(enumMap)) enumMap = getEnumByClazzEnum(enumName, MesEnumUtil.class); | ||||
|         if (CollectionUtils.isEmpty(enumMap)) enumMap = getEnumByClazzEnum(enumName, MesInterfaceEnumUtil.class); | ||||
|         return enumMap; | ||||
|     } | ||||
| 
 | ||||
|     public Map<String, Object> getEnumByClazzEnum(String enumName, Class clz) { | ||||
|         return EnumUtil.getEnumByName(clz, enumName); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,52 @@ | ||||
| package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.report; | ||||
| 
 | ||||
| 
 | ||||
| import cn.estsh.i3plus.ext.mes.pcn.api.report.IMesYfReportService; | ||||
| import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant; | ||||
| import cn.estsh.i3plus.pojo.base.common.Pager; | ||||
| import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn; | ||||
| import cn.estsh.impp.framework.base.controller.MesBaseController; | ||||
| import cn.estsh.impp.framework.boot.exception.ImppBusiException; | ||||
| import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; | ||||
| import cn.estsh.impp.framework.boot.util.ResultBean; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.RequestMapping; | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
| 
 | ||||
| /** | ||||
|  * @Description : Mes业务报表 | ||||
|  * @Reference : | ||||
|  * @Author : junsheng.li --copy by castle 2024-12-30 | ||||
|  * @CreateDate 2024/6/28 14:17 | ||||
|  * @Modify: | ||||
|  **/ | ||||
| @Api("Mes业务报表") | ||||
| @RestController | ||||
| @RequestMapping(MesCommonConstant.MES_YANFEN + "/report") | ||||
| public class MesBusiReportController  { | ||||
| 
 | ||||
|     @Autowired | ||||
|     private IMesYfReportService mesYfReportService; | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     @ApiOperation(value = "零件条码状态查询", notes = "零件条码状态查询") | ||||
|     @GetMapping("/mesProduceSn/query") | ||||
|     public ResultBean queryMesProduceSn(MesProduceSn mesProduceSn, Pager pager) { | ||||
|         try { | ||||
|             return ResultBean.success("查询成功").setListPager(mesYfReportService.queryMesProduceSn(mesProduceSn,pager)); | ||||
|         } catch (ImppBusiException e) { | ||||
|             return ResultBean.fail(e); | ||||
|         } catch (Exception e) { | ||||
|             return ImppExceptionBuilder.newInstance().buildExceptionResult(e); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,76 @@ | ||||
| package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.report; | ||||
| 
 | ||||
| 
 | ||||
| import cn.estsh.i3plus.ext.mes.pcn.api.report.IMesYfReportService; | ||||
| import cn.estsh.i3plus.platform.common.tool.TimeTool; | ||||
| import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; | ||||
| import cn.estsh.i3plus.pojo.base.bean.ListPager; | ||||
| import cn.estsh.i3plus.pojo.base.common.Pager; | ||||
| import cn.estsh.i3plus.pojo.base.common.PagerHelper; | ||||
| import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; | ||||
| import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; | ||||
| import cn.estsh.i3plus.pojo.mes.bean.*; | ||||
| import cn.estsh.i3plus.pojo.mes.model.MesProductionRecordModel; | ||||
| import cn.estsh.i3plus.pojo.mes.model.report.MesGeneralExportReportModel; | ||||
| import cn.estsh.i3plus.pojo.mes.model.report.MesGeneralShippingReportModel; | ||||
| import cn.estsh.i3plus.pojo.mes.repository.*; | ||||
| import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; | ||||
| import jodd.util.StringUtil; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.util.CollectionUtils; | ||||
| 
 | ||||
| import java.text.ParseException; | ||||
| import java.text.SimpleDateFormat; | ||||
| import java.util.*; | ||||
| import java.util.stream.Collectors; | ||||
| 
 | ||||
| /** | ||||
|  * @Description : 报表-业务方法实现 | ||||
|  * @Reference : | ||||
|  * @Author : logic | ||||
|  * @CreateDate : 2024/6/15 11:31 | ||||
|  * @Modify: | ||||
|  **/ | ||||
| @Service | ||||
| @Slf4j | ||||
| public class MesYfReportServiceImpl implements IMesYfReportService { | ||||
| 
 | ||||
| 
 | ||||
|     @Autowired | ||||
|     private MesProduceSnRepository mesProduceSnRDao; | ||||
| 
 | ||||
| 
 | ||||
|     @Override | ||||
|     public ListPager<MesProduceSn> queryMesProduceSn(MesProduceSn mesProduceSn, Pager pager) { | ||||
|         DdlPackBean packBean = getMesProduceSnPackBean(mesProduceSn); | ||||
|         if (Objects.isNull(pager)) { | ||||
|             DdlPreparedPack.getOrderBy(mesProduceSn.getOrderByParam(), mesProduceSn.getAscOrDesc(), packBean); | ||||
|             return new ListPager<>(mesProduceSnRDao.findByHqlWhere(packBean), pager); | ||||
|         } | ||||
|         pager = PagerHelper.getPager(pager, mesProduceSnRDao.findByHqlWhereCount(packBean)); | ||||
|         DdlPreparedPack.getOrderBy(mesProduceSn.getOrderByParam(), mesProduceSn.getAscOrDesc(), packBean); | ||||
|         return new ListPager<>(mesProduceSnRDao.findByHqlWherePage(packBean, pager), pager); | ||||
|     } | ||||
| 
 | ||||
|     private DdlPackBean getMesProduceSnPackBean(MesProduceSn mesProduceSn) { | ||||
|         DdlPackBean packBean = DdlPackBean.getDdlPackBean(mesProduceSn.getOrganizeCode()); | ||||
|         DdlPreparedPack.getStringLikerPack(mesProduceSn.getProductSn(), "productSn", packBean); | ||||
|         DdlPreparedPack.getStringLikerPack(mesProduceSn.getCustSn(), "custSn", packBean); | ||||
|         DdlPreparedPack.getStringLikerPack(mesProduceSn.getWorkOrderNo(), "workOrderNo", packBean); | ||||
|         DdlPreparedPack.getStringBiggerPack(mesProduceSn.getCreateDateTimeStart(), "createDatetime", packBean); | ||||
|         DdlPreparedPack.getStringSmallerPack(mesProduceSn.getCreateDateTimeEnd(), "createDatetime", packBean); | ||||
|         DdlPreparedPack.getNumEqualPack(mesProduceSn.getSnStatus(), "snStatus", packBean); | ||||
|         DdlPreparedPack.getNumEqualPack(mesProduceSn.getQcStatus(), "qcStatus", packBean); | ||||
|         DdlPreparedPack.getStringLikerPack(mesProduceSn.getPartNo(), "partNo", packBean); | ||||
|         DdlPreparedPack.getStringLikerPack(mesProduceSn.getPartName(), "partName", packBean); | ||||
|         DdlPreparedPack.getStringLikerPack(mesProduceSn.getWorkCenterCode(), "workCenterCode", packBean); | ||||
|         DdlPreparedPack.getNumEqualPack(mesProduceSn.getPrintCount(), "printCount", packBean); | ||||
|         DdlPreparedPack.getNumEqualPack(mesProduceSn.getPrintStatus(), "printStatus", packBean); | ||||
|         DdlPreparedPack.getStringLikerPack(mesProduceSn.getWorkCellCode(), "workCellCode", packBean); | ||||
|         DdlPreparedPack.getStringLikerPack(mesProduceSn.getCreateUser(), "createUser", packBean); | ||||
|         return packBean; | ||||
|     } | ||||
| 
 | ||||
| } | ||||
					Loading…
					
					
				
		Reference in New Issue