Merge remote-tracking branch 'origin/master'

highway
wws 1 year ago
commit 22bd4abe35

@ -63,7 +63,7 @@ public class WCSInterfaceController extends BaseController {
if(CollectionUtils.isEmpty(lgdtos)){ if(CollectionUtils.isEmpty(lgdtos)){
return error("参数信息为空"); return error("参数信息为空");
} }
if(StringUtils.isNotBlank(lgdtos.get(0).getFactoryCode())){ if(StringUtils.isBlank(lgdtos.get(0).getFactoryCode())){
return error("工厂信息为空"); return error("工厂信息为空");
} }
return success(WCInterfaceService.saveLGusedLog(lgdtos)); return success(WCInterfaceService.saveLGusedLog(lgdtos));
@ -87,7 +87,7 @@ public class WCSInterfaceController extends BaseController {
boardDTO.setYmd(DateUtils.getDate()); boardDTO.setYmd(DateUtils.getDate());
} }
if(StringUtils.isEmpty(boardDTO.getEquTypeCode())){ if(StringUtils.isEmpty(boardDTO.getEquTypeCode())){//设备类型
return error("[equTypeCode] is not null"); return error("[equTypeCode] is not null");
} }
return success(WCInterfaceService.getMesBoardEquProductionToday(boardDTO)); return success(WCInterfaceService.getMesBoardEquProductionToday(boardDTO));

@ -34,4 +34,8 @@ public interface MesMapper {
List<SysDept> getBoardFactory(BoardDTO boardDTO); List<SysDept> getBoardFactory(BoardDTO boardDTO);
int addBatchLGInfo(@Param("list") List<LGInfoDto> lgdtos); int addBatchLGInfo(@Param("list") List<LGInfoDto> lgdtos);
List<BoardDTO> getTotalNumL(BoardDTO boardDTO);
List<BoardDTO> getEveryNumL(BoardDTO boardDTO);
} }

@ -147,10 +147,17 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
public Map getMesBoardEquProductionToday(BoardDTO boardDTO) { public Map getMesBoardEquProductionToday(BoardDTO boardDTO) {
DynamicDataSourceContextHolder.push("ds_"+boardDTO.getFactory());// 这是数据源的key DynamicDataSourceContextHolder.push("ds_"+boardDTO.getFactory());// 这是数据源的key
Map boardMap = new HashMap(); Map boardMap = new HashMap();
List<BoardDTO> totals = null;
List<BoardDTO> everys = null;
if("equ_type_lg".equals(boardDTO.getEquTypeCode())){//equ_type_lg 湿料罐
boardDTO.setYmd(boardDTO.getYmd().replace("-",""));
totals = mesMapper.getTotalNumL(boardDTO);
everys = mesMapper.getEveryNumL(boardDTO);
}else{//成型机、烘房、收坯机
totals = mesMapper.getTotalNum(boardDTO);
everys = mesMapper.getEveryNum(boardDTO);
}
List<BoardDTO> totals = mesMapper.getTotalNum(boardDTO);//
List<BoardDTO> everys = mesMapper.getEveryNum(boardDTO);//
boardMap.put("totalNum", totals); boardMap.put("totalNum", totals);
boardMap.put("everyNum", everys); boardMap.put("everyNum", everys);
@ -159,7 +166,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
@Override @Override
public List<SysDept> getBoardFactory(BoardDTO boardDTO) { public List<SysDept> getBoardFactory(BoardDTO boardDTO) {
//DynamicDataSourceContextHolder.push("master");// 这是数据源的key DynamicDataSourceContextHolder.push("master");// 这是数据源的key
return mesMapper.getBoardFactory(boardDTO); return mesMapper.getBoardFactory(boardDTO);
} }
@ -170,6 +177,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
for(LGInfoDto lgdto:lgdtos){ for(LGInfoDto lgdto:lgdtos){
lgdto.setId(IdUtils.simpleUUID()); lgdto.setId(IdUtils.simpleUUID());
lgdto.setCreateTime(nowTime); lgdto.setCreateTime(nowTime);
lgdto.setDeviceCode("L"+lgdto.getDeviceCode());
} }
int saveNum = mesMapper.addBatchLGInfo(lgdtos); int saveNum = mesMapper.addBatchLGInfo(lgdtos);

@ -51,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item.id},#{item.deviceCode}, #{item.id},#{item.deviceCode},
#{item.used},#{item.usedUnit}, #{item.used},#{item.usedUnit},
#{item.createDate},#{item.lgCreateTime}, #{item.createDate},#{item.lgCreateTime},
#{item.factoryCode},#{item.createTime}, #{item.factoryCode},#{item.createTime}
) )
</foreach> </foreach>
</insert> </insert>
@ -112,6 +112,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dept_name deptName dept_name deptName
from sys_dept where parent_id = '1' and del_flag = '0' from sys_dept where parent_id = '1' and del_flag = '0'
</select> </select>
<select id="getTotalNumL" resultType="com.op.system.api.domain.dto.BoardDTO">
select count(0) totalNum,
equ.equipment_type_code equTypeCode,
equ.equipment_type_name equTypeName
from pro_lg_used_log mt
left join base_equipment equ on mt.device_code = equ.equipment_code
where mt.createDate = #{ymd} and equ.equipment_name is not null
and equ.equipment_type_code = #{equTypeCode}
group by equ.equipment_type_code,
equ.equipment_type_name
</select>
<select id="getEveryNumL" resultType="com.op.system.api.domain.dto.BoardDTO">
select count(0) totalNum,
mt.device_code equCode,
equ.equipment_name equName,
equ.equipment_type_code equTypeCode
from pro_lg_used_log mt
left join base_equipment equ on mt.device_code = equ.equipment_code
where mt.createDate = #{ymd} and equ.equipment_name is not null
and equ.equipment_type_code = #{equTypeCode}
group by mt.device_code,
equ.equipment_name,
equ.equipment_type_code
</select>
</mapper> </mapper>

Loading…
Cancel
Save