Merge remote-tracking branch 'origin/master'

highway
wws 1 year ago
commit eabf618a1a

@ -7,11 +7,13 @@ import com.op.common.core.web.domain.AjaxResult;
import com.op.common.log.annotation.Log; import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType; import com.op.common.log.enums.BusinessType;
import com.op.mes.domain.dto.BaseEquipmentDto; import com.op.mes.domain.dto.BaseEquipmentDto;
import com.op.mes.domain.dto.LGInfoDto;
import com.op.system.api.domain.dto.BoardDTO; import com.op.system.api.domain.dto.BoardDTO;
import com.op.system.api.domain.dto.WCSDTO; import com.op.system.api.domain.dto.WCSDTO;
import com.op.mes.service.IWCSInterfaceService; import com.op.mes.service.IWCSInterfaceService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
@ -55,6 +57,18 @@ public class WCSInterfaceController extends BaseController {
return success(WCInterfaceService.requestDestinationStations(wcsdto)); return success(WCInterfaceService.requestDestinationStations(wcsdto));
} }
@Log(title = "获取料罐用量", businessType = BusinessType.GRANT)
@PostMapping("/saveLGusedLog")
public AjaxResult saveLGusedLog(@RequestBody List<LGInfoDto> lgdtos) {
if(CollectionUtils.isEmpty(lgdtos)){
return error("参数信息为空");
}
if(StringUtils.isNotBlank(lgdtos.get(0).getFactoryCode())){
return error("工厂信息为空");
}
return success(WCInterfaceService.saveLGusedLog(lgdtos));
}
/** /**
* MES * MES
*/ */
@ -72,6 +86,14 @@ public class WCSInterfaceController extends BaseController {
if(StringUtils.isEmpty(boardDTO.getYmd())){ if(StringUtils.isEmpty(boardDTO.getYmd())){
boardDTO.setYmd(DateUtils.getDate()); boardDTO.setYmd(DateUtils.getDate());
} }
if(StringUtils.isEmpty(boardDTO.getEquTypeCode())){
return error("[equTypeCode] is not null");
}
return success(WCInterfaceService.getMesBoardEquProductionToday(boardDTO)); return success(WCInterfaceService.getMesBoardEquProductionToday(boardDTO));
} }
public static void main(String args[]){
System.out.println(DateUtils.getDate());
}
} }

@ -0,0 +1,104 @@
package com.op.mes.domain.dto;
import java.util.Date;
import java.util.List;
/**
*
*
* @author Open Platform
* @date 2023-07-03
*/
public class LGInfoDto {
private String deviceCode;
private String deviceName;
private String id;
private String used;
private String usedUnit;
private String createDate;
private Date lgCreateTime;
private Date createTime;
private String factoryCode;
private String delFlag;
public Date getLgCreateTime() {
return lgCreateTime;
}
public void setLgCreateTime(Date lgCreateTime) {
this.lgCreateTime = lgCreateTime;
}
public String getCreateDate() {
return createDate;
}
public void setCreateDate(String createDate) {
this.createDate = createDate;
}
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getUsed() {
return used;
}
public void setUsed(String used) {
this.used = used;
}
public String getUsedUnit() {
return usedUnit;
}
public void setUsedUnit(String usedUnit) {
this.usedUnit = usedUnit;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}

@ -1,11 +1,13 @@
package com.op.mes.mapper; package com.op.mes.mapper;
import com.op.mes.domain.dto.BaseEquipmentDto; import com.op.mes.domain.dto.BaseEquipmentDto;
import com.op.mes.domain.dto.LGInfoDto;
import com.op.system.api.domain.SysDept; import com.op.system.api.domain.SysDept;
import com.op.system.api.domain.dto.BoardDTO; import com.op.system.api.domain.dto.BoardDTO;
import com.op.system.api.domain.dto.WCSDTO; import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.dto.WCSDataItemsDTO; import com.op.system.api.domain.dto.WCSDataItemsDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -30,4 +32,6 @@ public interface MesMapper {
List<BoardDTO> getEveryNum(BoardDTO boardDTO); List<BoardDTO> getEveryNum(BoardDTO boardDTO);
List<SysDept> getBoardFactory(BoardDTO boardDTO); List<SysDept> getBoardFactory(BoardDTO boardDTO);
int addBatchLGInfo(@Param("list") List<LGInfoDto> lgdtos);
} }

@ -2,6 +2,7 @@ package com.op.mes.service;
import com.op.common.core.web.domain.AjaxResult; import com.op.common.core.web.domain.AjaxResult;
import com.op.mes.domain.dto.BaseEquipmentDto; import com.op.mes.domain.dto.BaseEquipmentDto;
import com.op.mes.domain.dto.LGInfoDto;
import com.op.system.api.domain.SysDept; import com.op.system.api.domain.SysDept;
import com.op.system.api.domain.dto.BoardDTO; import com.op.system.api.domain.dto.BoardDTO;
import com.op.system.api.domain.dto.WCSDTO; import com.op.system.api.domain.dto.WCSDTO;
@ -22,4 +23,6 @@ public interface IWCSInterfaceService {
Map getMesBoardEquProductionToday(BoardDTO boardDTO); Map getMesBoardEquProductionToday(BoardDTO boardDTO);
List<SysDept> getBoardFactory(BoardDTO boardDTO); List<SysDept> getBoardFactory(BoardDTO boardDTO);
String saveLGusedLog(List<LGInfoDto> lgdtos);
} }

@ -8,6 +8,7 @@ import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils; import com.op.common.security.utils.SecurityUtils;
import com.op.mes.domain.MesStationArrive; import com.op.mes.domain.MesStationArrive;
import com.op.mes.domain.dto.BaseEquipmentDto; import com.op.mes.domain.dto.BaseEquipmentDto;
import com.op.mes.domain.dto.LGInfoDto;
import com.op.mes.mapper.MesMapper; import com.op.mes.mapper.MesMapper;
import com.op.mes.mapper.MesStationArriveMapper; import com.op.mes.mapper.MesStationArriveMapper;
import com.op.mes.mapper.ProRfidProcessDetailMapper; import com.op.mes.mapper.ProRfidProcessDetailMapper;
@ -162,6 +163,19 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
return mesMapper.getBoardFactory(boardDTO); return mesMapper.getBoardFactory(boardDTO);
} }
@Override
public String saveLGusedLog(List<LGInfoDto> lgdtos) {
DynamicDataSourceContextHolder.push("ds_"+lgdtos.get(0).getFactoryCode());// 这是数据源的key
Date nowTime = DateUtils.getNowDate();
for(LGInfoDto lgdto:lgdtos){
lgdto.setId(IdUtils.simpleUUID());
lgdto.setCreateTime(nowTime);
}
int saveNum = mesMapper.addBatchLGInfo(lgdtos);
return "保存成功条数:"+saveNum;
}
public static void main(String args[]){ public static void main(String args[]){
System.out.println(DateUtils.getDate()); System.out.println(DateUtils.getDate());

@ -39,6 +39,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="factoryCode != null">#{factoryCode},</if> <if test="factoryCode != null">#{factoryCode},</if>
</trim> </trim>
</insert> </insert>
<insert id="addBatchLGInfo">
insert into pro_lg_used_log(
id,device_code,
used,used_unit,
createDate,lg_create_time,
factory_code,create_time
) values
<foreach item="item" index="index" collection="list" separator=",">
(
#{item.id},#{item.deviceCode},
#{item.used},#{item.usedUnit},
#{item.createDate},#{item.lgCreateTime},
#{item.factoryCode},#{item.createTime},
)
</foreach>
</insert>
<select id="getWetPlanDetail" resultType="com.op.system.api.domain.dto.WCSDataItemsDTO"> <select id="getWetPlanDetail" resultType="com.op.system.api.domain.dto.WCSDataItemsDTO">
select select
@ -73,7 +89,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
equ.equipment_type_name equTypeName equ.equipment_type_name equTypeName
from mes_material_transfer_result mt from mes_material_transfer_result mt
left join base_equipment equ on mt.equipmentCode = equ.equipment_code left join base_equipment equ on mt.equipmentCode = equ.equipment_code
where CONVERT(varchar(10),mt.create_time, 120) = #{ymd} and equ.equipment_name is not null where CONVERT(varchar(10),mt.update_time, 120) = #{ymd} and equ.equipment_name is not null
and equ.equipment_type_code = #{equTypeCode}
group by equ.equipment_type_code, group by equ.equipment_type_code,
equ.equipment_type_name equ.equipment_type_name
</select> </select>
@ -84,7 +101,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
equ.equipment_type_code equTypeCode equ.equipment_type_code equTypeCode
from mes_material_transfer_result mt from mes_material_transfer_result mt
left join base_equipment equ on mt.equipmentCode = equ.equipment_code left join base_equipment equ on mt.equipmentCode = equ.equipment_code
where CONVERT(varchar(10),mt.create_time, 120) = #{ymd} and equ.equipment_name is not null where CONVERT(varchar(10),mt.update_time, 120) = #{ymd} and equ.equipment_name is not null
and equ.equipment_type_code = #{equTypeCode}
group by mt.equipmentCode, group by mt.equipmentCode,
equ.equipment_name, equ.equipment_name,
equ.equipment_type_code equ.equipment_type_code

Loading…
Cancel
Save