Merge remote-tracking branch 'origin/master'

master
mengjiao 10 months ago
commit 2b7e105dff

@ -460,10 +460,9 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
for (EquOperation operation : operationList) {
operation.setId(IdUtils.fastSimpleUUID());// id
operation.setFactoryCode(poolName.replace("ds_", ""));// 工厂
operation.setOperationTime(DateUtils.getTime());// 日期
operation.setOperationTime(operationTime);// 运行时间(默认运行时间)
operation.setActualOperationTime(operationTime);// 实际运行时间(默认运行时间)
operation.setCreateBy("jod");
operation.setCreateBy("job");
operation.setCreateTime(DateUtils.getNowDate());
}

@ -506,6 +506,7 @@ public class EquPlanServiceImpl implements IEquPlanService {
* @return
*/
private AjaxResult formatEquItemCommon(List<EquPlanEqu> equPlanEquList, String planType, String message) {
String equipmentList = "";
for (EquPlanEqu data : equPlanEquList) {
// 检查项名称临时对象
@ -552,10 +553,16 @@ public class EquPlanServiceImpl implements IEquPlanService {
data.setItemTempName(itemTempName.toString());//处理好的检查项名称置入检查项名称(用于前端信息回显)
} else {
// 未查询到对应检查项信息
return error(500, message);
equipmentList = equipmentList + '[' + data.getEquipmentCode() + "]";
}
}
return success(equPlanEquList);
if(!equipmentList.equals("")){
equipmentList = equipmentList + "设备未查询到对应检查项信息!";
message = equipmentList;
return error(500, message);
}else{
return success(equPlanEquList);
}
}
/**

@ -177,8 +177,9 @@ public class EquSpotCheckServiceImpl implements IEquSpotCheckService {
equipmentList = equipmentList + "设备未查询到对应检查项信息!";
message = equipmentList;
return error(500, message);
}else{
return success(equPlanEquList);
}
return success(equPlanEquList);
}
}

@ -83,7 +83,10 @@
</select>
<select id="selectAllEquipmentList" resultType="com.op.device.domain.vo.EquCheckItemVO">
select equipment_name AS 'equipmentName',equipment_code AS 'equipmentCode' from base_equipment where del_flag = '0' and equipment_category = '0'
select equipment_name AS 'equipmentName',equipment_code AS 'equipmentCode'
from base_equipment
where del_flag = '0'
and equipment_category != '1'
</select>
<select id="selectCheckItemByEquipmentCode" parameterType="String" resultMap="EquCheckItemResult">

@ -118,12 +118,10 @@
zx.equipment_name AS 'groupLine',
be.workshop_name AS 'workshop'
from base_equipment be
left join equ_bind_auxiliary_equipment bae
on bae.auxiliary_equipment_code = be.equipment_code
left join base_equipment zx
on bae.equipment_code = zx.equipment_code
left join equ_bind_auxiliary_equipment bae on bae.auxiliary_equipment_code = be.equipment_code
left join base_equipment zx on bae.equipment_code = zx.equipment_code
where be.del_flag = '0'
and be.equipment_category = '0'
and be.equipment_category != '1'
</select>
<select id="checkInsertOperation" resultType="java.lang.Integer">

@ -36,7 +36,7 @@ public class MesBoardController extends BaseController {
/**计划产量、当前产量、15天的产量趋势图**/
@PostMapping("/getProduction15Days")
public AjaxResult getProduction15Days(BoardDTO mesBoard) {
public AjaxResult getProduction15Days(@RequestBody BoardDTO mesBoard) {
if (StringUtils.isBlank(mesBoard.getFactoryCode())) {
return error("[facotryCode] 不能为空");
}
@ -48,9 +48,9 @@ public class MesBoardController extends BaseController {
/**产线信息**/
@PostMapping("/getProductionLineInfo")
public AjaxResult getProductionLineInfo(BoardDTO mesBoard) {
public AjaxResult getProductionLineInfo(@RequestBody BoardDTO mesBoard) {
if (StringUtils.isBlank(mesBoard.getFactoryCode())) {
return error("[facotryCode] 不能为空");
return error("[factoryCode] 不能为空");
}
if (StringUtils.isBlank(mesBoard.getEquCode())) {
return error("[equCode] 不能为空");

@ -77,7 +77,7 @@ public interface MesMapper {
List<BoardDTO> getLineList(BoardDTO boardDTO);
@MapKey("dayStr")
@MapKey("productDate")
Map<String, MesReportWork> getProduction15Days(BoardDTO boardDTO);
BoardDTO getWorkOrder(BoardDTO boardDTO);

@ -185,6 +185,15 @@ public class QcCheckReportIncome extends BaseEntity {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date confirmTime;
private Boolean myself;
private String shiftId;
public String getShiftId() {
return shiftId;
}
public void setShiftId(String shiftId) {
this.shiftId = shiftId;
}
public Boolean getMyself() {
return myself;

@ -205,6 +205,15 @@ public class QcCheckTaskProduce extends BaseEntity {
private String confirm;
private String confirmRemark;
private String confirmTime;
private String shiftId;
public String getShiftId() {
return shiftId;
}
public void setShiftId(String shiftId) {
this.shiftId = shiftId;
}
public String getConfirm() {
return confirm;

@ -41,7 +41,7 @@ public class QcStaticTable extends BaseEntity {
private String typeCode;
private String checkResult;
private String noOkBatchRate;
private String shiftId;
private String ymArrayStart;
private String ymArrayEnd;
private List<String> legendData;
@ -106,6 +106,14 @@ public class QcStaticTable extends BaseEntity {
private List<HashMap> details;
private String[] projectNoArray;
public String getShiftId() {
return shiftId;
}
public void setShiftId(String shiftId) {
this.shiftId = shiftId;
}
public String[] getProjectNoArray() {
return projectNoArray;
}

@ -51,6 +51,8 @@ public interface QcStaticTableMapper {
@MapKey("ymdms")
Map<String, QcStaticTable> getProjectDetail(QcStaticTable qcStaticTable);
@MapKey("ymdms")
Map<String, QcStaticTable> getProjectDetailNight(QcStaticTable qcStaticTable);
List<String> getBatchnos(String orderNo);

@ -218,6 +218,7 @@ public class QcCheckReportProduceServiceImpl implements IQcCheckReportProduceSer
QcStaticTable qcStaticTable = new QcStaticTable();
qcStaticTable.setOrderNo(qcCheckTaskProduce.getOrderNo());
qcStaticTable.setShiftId(qcCheckTaskProduce.getShiftId());
List<QcStaticTable> checkInfos = qcStaticTableService.getXJCheckTableDetail(qcStaticTable);
produce.setCheckInfos(checkInfos);
QcCheckTaskProduce lastProduce = qcCheckReportIncomeMapper.getLastProductTypeInfo(qcCheckTaskProduce);

@ -171,7 +171,13 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
@DS("#header.poolName")
public List<QcStaticTable> getXJCheckTableDetail(QcStaticTable qcStaticTable) {
List<QcStaticTable> projects = qcStaticTableMapper.getXJProjects(qcStaticTable);
Map<String, QcStaticTable> detailMap = qcStaticTableMapper.getProjectDetail(qcStaticTable);
Map<String, QcStaticTable> detailMap = null;
if(qcStaticTable.getShiftId().equals("5")){
detailMap = qcStaticTableMapper.getProjectDetail(qcStaticTable);
}else if(qcStaticTable.getShiftId().equals("2")){
detailMap = qcStaticTableMapper.getProjectDetailNight(qcStaticTable);
}
Map<String, QcStaticTable> picsMap = qcStaticTableMapper.picsMap(qcStaticTable);
for (QcStaticTable project : projects) {
this.getDataFromMap(detailMap, project, picsMap);

@ -82,7 +82,8 @@
<result property="confirm" column="confirm"/>
<result property="confirmManCode" column="confirm_man_code"/>
<result property="confirmManName" column="confirm_man_name"/>
<result property="confirmManName" column="confirm_remark"/>
<result property="confirmRemark" column="confirm_remark"/>
<result property="shiftId" column="shift_id"/>
</resultMap>
<sql id="selectQcCheckTaskProduceVo">
@ -339,7 +340,7 @@
</select>
<select id="selectQcCheckReportIncomeList" parameterType="QcCheckReportIncome"
resultMap="QcCheckReportIncomeResult">
select * from (
select t.*,pow.shift_id from (
select qct.record_id, qct.check_no, qct.income_batch_no,
qct.order_no, qct.material_code, qct.material_name, qct.quality, qct.unit,
qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_loc, qct.check_status,
@ -409,6 +410,7 @@
qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_type,CONVERT(varchar(10),qct.create_time, 120),
qct.confirm,qct.confirm_man_name
) t
left join pro_order_workorder pow on pow.workorder_code = t.order_no
where 1=1
<if test="checkType != null ">
and t.check_type = #{checkType}

@ -43,7 +43,7 @@
product_group groupCode,
concat(product_group_name,'(',product_group,')') groupName
FROM base_product
WHERE del_flag = '0'
WHERE del_flag = '0' AND product_group_name IS NOT NULL
</select>
<select id="getMaterialChildrenList" parameterType="QcMaterialGroup" resultMap="QcMaterialGroupResult">

@ -179,6 +179,34 @@
</select>
<select id="getProjectDetailNight" resultType="com.op.quality.domain.QcStaticTable">
select qctd.record_id recordId,
qctd.project_id projectId,
qctd.status,
qctd.remark,
CONVERT(VARCHAR(5),qctd.create_time, 108),
concat(qctd.project_id,
case when '21:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '20:30' then '08'
when '22:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '21:30' then '09'
when '23:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '22:30' then '10'
when '23:59'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '23:30' then '11'
when '01:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '00:00' then '11'
when '02:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '01:30' then '12'
when '03:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '02:30' then '13'
when '04:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '03:30' then '14'
when '05:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '04:30' then '15'
when '06:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '05:30' then '16'
when '07:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '06:30' then '18'
when '08:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '07:30' then '19'
else '-' end
)ymdms
from qc_check_task qct
left join qc_check_task_detail qctd on qct.record_id = qctd.belong_to
where qct.order_no = #{orderNo} and qct.check_type = 'checkTypeSCXJ' and qct.check_status = '2'
order by qctd.create_time
</select>
<select id="getBatchnos" resultType="java.lang.String">
select powb.batch_code batchCode
from pro_order_workorder_batch powb

@ -24,6 +24,10 @@ import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@RestController
@RequestMapping("/sap")
@ -66,8 +70,37 @@ public class SapController extends BaseController {
@PostMapping("/itemSync")
@Log(title = "同步SAP物料清单", businessType = BusinessType.SAP)
public R itemSync(@RequestBody SapItemQuery qo) {
// 加载sf-cloud库的sys_datasource
return sapItemSyncService.itemSync(qo);
SysUser sysUser = new SysUser();
sysUser.setUserId(1L);
R<List<Map<String, String>>> dateSources0 = remoteUserService.getPoolNameList(sysUser);
List<Map<String, String>> dateSources = dateSources0.getData();
ExecutorService executorService = new ThreadPoolExecutor(
dateSources.size(),
dateSources.size(),
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>());
try {
dateSources.forEach(dateSource -> {
if(!"ds_999".equals(dateSource.get("poolName"))){
SapItemQuery sapItemQuery = new SapItemQuery();
sapItemQuery.setWerks(dateSource.get("poolName").replace("ds_",""));
Runnable run = () -> sapItemSyncService.itemSync(sapItemQuery);
executorService.execute(run);
}
});
} catch (Exception e) {
logger.error("controller == createIncomeBatchTask == exception", e);
return R.fail("controller == createIncomeBatchTask == exception");
} finally {
executorService.shutdown();
}
return R.ok();
}
/**

@ -53,6 +53,12 @@ public class SapItemSyncImpl implements SapItemSyncService {
@Override
public R itemSync(SapItemQuery sapItemQuery) {
try {
DynamicDataSourceContextHolder.push("ds_"+sapItemQuery.getWerks());
//TODO;
//sapItemQuery.setLaeda();
//sapItemQuery.setErsda();
// 获取调用 RFC 函数对象
//获取连接
log.info("物料基础数据同步输入参数---------" + JSONObject.toJSONString(sapItemQuery));

Loading…
Cancel
Save