Merge remote-tracking branch 'origin/master'

master
mengjiao 10 months ago
commit c5f002597a

@ -11,6 +11,87 @@ public class BoardDTO {
private String equTypeCode;
private String equTypeName;
private String shiftId;
private String factoryCode;
private String equipmentTypeCode;
private String planProduction;
private String actProduction;
private List<String> plans;
private List<String> acts;
private List<String> days;
private String startTime;
private String endTime;
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public List<String> getDays() {
return days;
}
public void setDays(List<String> days) {
this.days = days;
}
public String getPlanProduction() {
return planProduction;
}
public void setPlanProduction(String planProduction) {
this.planProduction = planProduction;
}
public String getActProduction() {
return actProduction;
}
public void setActProduction(String actProduction) {
this.actProduction = actProduction;
}
public List<String> getPlans() {
return plans;
}
public void setPlans(List<String> plans) {
this.plans = plans;
}
public List<String> getActs() {
return acts;
}
public void setActs(List<String> acts) {
this.acts = acts;
}
public String getEquipmentTypeCode() {
return equipmentTypeCode;
}
public void setEquipmentTypeCode(String equipmentTypeCode) {
this.equipmentTypeCode = equipmentTypeCode;
}
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getShiftId() {
return shiftId;

@ -1,19 +1,21 @@
package com.op.mes.controller;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.mes.domain.MesBoard;
import com.op.mes.service.IMesBoradService;
import com.op.system.api.domain.dto.BoardDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/mesborad")
public class MesBoardController {
public class MesBoardController extends BaseController {
@Autowired
private IMesBoradService iMesBoradService;
@ -25,5 +27,21 @@ public class MesBoardController {
public AjaxResult finishProductBoard(@RequestBody BoardDTO boardDTO) {
return iMesBoradService.finishProductBoard(boardDTO);
}
/******************************自动化产线方案看板****************************************/
/**根据工厂获取产线**/
@GetMapping("/getLineList")
public List<BoardDTO> getLineList(BoardDTO mesBoard) {
return iMesBoradService.getLineList(mesBoard);
}
@PostMapping("/getProduction15Days")
public AjaxResult getProduction15Days(BoardDTO mesBoard) {
if (StringUtils.isBlank(mesBoard.getFactoryCode())) {
return error("[facotryCode] 不能为空");
}
if (StringUtils.isBlank(mesBoard.getEquCode())) {
return error("[equCode] 不能为空");
}
return success(iMesBoradService.getProduction15Days(mesBoard));
}
}

@ -19,6 +19,24 @@ public class MesBoard {
private List<BaseFileData> files;
private String workshopCode;
private String workshopName;
private String lineCode;
private String lineName;
public String getLineCode() {
return lineCode;
}
public void setLineCode(String lineCode) {
this.lineCode = lineCode;
}
public String getLineName() {
return lineName;
}
public void setLineName(String lineName) {
this.lineName = lineName;
}
public String getWorkshopCode() {
return workshopCode;

@ -179,10 +179,10 @@ public class MesReportWork extends BaseEntity {
private String routeCode;
private String sac1;
private String sac2;
private String sac3;
private String sac4;
private String sac5;
private String sac6;
private String sac3;
private String sac4;
private String sac5;
private String sac6;
private String prodType;
private String createTimeStart;
private String createTimeEnd;

@ -2,6 +2,7 @@ package com.op.mes.mapper;
import com.op.common.core.domain.BaseFileData;
import com.op.mes.domain.MesBoard;
import com.op.mes.domain.MesReportWork;
import com.op.mes.domain.dto.BaseEquipmentDto;
import com.op.mes.domain.dto.LGInfoDto;
import com.op.system.api.domain.SysDept;
@ -9,6 +10,7 @@ import com.op.system.api.domain.SysSapLog;
import com.op.system.api.domain.dto.BoardDTO;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.dto.WCSDataItemsDTO;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -72,4 +74,9 @@ public interface MesMapper {
List<Map<String, String>> daySenvenProduction();
List<Map<String, String>> ProductionInProgress();
List<BoardDTO> getLineList(BoardDTO boardDTO);
@MapKey("dayStr")
Map<String, MesReportWork> getProduction15Days(BoardDTO boardDTO);
}

@ -144,4 +144,6 @@ public interface MesReportWorkMapper {
List<MesReportWorkConsume> getUpdateAttr1Boms(MesReportWork workorderCode);
int updateAttr2(MesReportWork workorder);
void updateReportRemark(@Param("list") List<MesReportWork> mesReportWork);
}

@ -3,6 +3,12 @@ package com.op.mes.service;
import com.op.common.core.web.domain.AjaxResult;
import com.op.system.api.domain.dto.BoardDTO;
import java.util.List;
public interface IMesBoradService {
public AjaxResult finishProductBoard(BoardDTO boardDTO);
public List<BoardDTO> getLineList(BoardDTO boardDTO);
public BoardDTO getProduction15Days(BoardDTO mesBoard);
}

@ -1,17 +1,19 @@
package com.op.mes.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.mes.domain.MesReportWork;
import com.op.mes.mapper.MesMapper;
import com.op.mes.service.IMesBoradService;
import com.op.system.api.domain.dto.BoardDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.text.SimpleDateFormat;
import java.util.*;
@Service
public class MesBoradServiceImpl implements IMesBoradService {
@ -34,4 +36,86 @@ public class MesBoradServiceImpl implements IMesBoradService {
map.put("ProductionInProgress", ProductionInProgress);
return AjaxResult.success(map);
}
@Override
public List<BoardDTO> getLineList(BoardDTO boardDTO) {
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
boardDTO.setEquipmentTypeCode("equ_type_bzx");
List<BoardDTO> lineList = mesMapper.getLineList(boardDTO);
return lineList;
}
@Override
public BoardDTO getProduction15Days(BoardDTO boardDTO) {
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
BoardDTO dto = new BoardDTO();
String nowDate = DateUtils.getDate();
List<String> days = this.getDays(15);
//days
dto.setDays(days);
boardDTO.setStartTime(days.get(0));
boardDTO.setEndTime(days.get(days.size()-1));
Map<String,MesReportWork> pros15 = mesMapper.getProduction15Days(boardDTO);
MesReportWork todaydto = pros15.get(nowDate);
if(todaydto != null){
dto.setPlanProduction(todaydto.getQuantity().toString().replace(".00",""));
dto.setActProduction(todaydto.getQuantityFeedback().toString());
}else{
dto.setPlanProduction("0");
dto.setActProduction("0");
}
//plans;
List<String> plans = new ArrayList<>();
List<String> acts = new ArrayList<>();
//acts;
for(String dayStr:days){
MesReportWork workR = pros15.get(dayStr);
if(workR != null){
plans.add(workR.getQuantity().toString());
acts.add(workR.getQuantityFeedback().toString());
}else{
plans.add("0");
acts.add("0");
}
}
dto.setPlans(plans);
dto.setActs(acts);
return dto;
}
//获取当前日期前几天
private List<String> getDays(int dayNum){
List<String> days = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar cal = Calendar.getInstance();
//获取前面的时间用-负号
Date date = new Date();
for(int num=0;num<dayNum;num++){
cal.setTime(date);
cal.add(Calendar.DAY_OF_MONTH, -num);
days.add(sdf.format(cal.getTime()));
}
Collections.reverse(days);
return days;
}
public static void main(String[] args){
List<String> days = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar cal = Calendar.getInstance();
//获取前面的时间用-负号
Date date = new Date();
for(int num=0;num<15;num++){
cal.setTime(date);
cal.add(Calendar.DAY_OF_MONTH, -num);
days.add(sdf.format(cal.getTime()));
}
Collections.reverse(days);
System.out.println(JSONObject.toJSONString(days));
}
}

@ -8,7 +8,6 @@ import java.util.*;
import com.alibaba.fastjson2.JSONArray;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.constant.SecurityConstants;
import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.ServletUtils;
@ -260,6 +259,9 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
mesReportWork.setUpdateTime(nowTime);
mesReportWork.setUpdateBy(updateBy);
}
//会更新好几次//着急发布后面再说
mesReportWorkMapper.updateReportRemark(mesReportWorks);
return mesReportWorkMapper.submitReportPS(mesReportWorks);
}

@ -112,7 +112,7 @@ public class MesUnitPriceServiceImpl implements IMesUnitPriceService {
@DS("#header.poolName")
public String importMesUnitPrice(List<MesUnitPrice> UnitPriceList, Boolean updateSupport, String operName) {
if (StringUtils.isNull(UnitPriceList) || UnitPriceList.size() == 0) {
throw new ServiceException("导入用户数据不能为空!");
throw new ServiceException("导入计件薪酬基础数据不能为空!");
}
int successNum = 0;
int failureNum = 0;
@ -146,34 +146,5 @@ public class MesUnitPriceServiceImpl implements IMesUnitPriceService {
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
}
return successMsg.toString();
// if (StringUtils.isNull(UnitPriceList) || UnitPriceList.size() == 0) {
// throw new ServiceException("导入数据不能为空!");
// }
// int successNum = 0;
// int failureNum = 0;
// StringBuilder successMsg = new StringBuilder();
// StringBuilder failureMsg = new StringBuilder();
// for (MesUnitPrice mesUnitPrice : UnitPriceList) {
// try {
// // 验证是否存在这个产线产品
// mesUnitPrice.setPicId(IdUtils.simpleUUID());
// mesUnitPriceMapper.insertMesUnitPrice(mesUnitPrice);
// successNum++;
// successMsg.append("导入成功");
//
// } catch (Exception e) {
// failureNum++;
// String msg = "导入失败:";
// failureMsg.append(msg + e.getMessage());
// log.error(msg, e);
// }
// }
// if (failureNum > 0) {
// failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
// throw new ServiceException(failureMsg.toString());
// } else {
// successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
// }
// return successMsg.toString();
}
}

@ -286,4 +286,23 @@
A.unit,
C.equipment_name;
</select>
<select id="getLineList" resultType="com.op.system.api.domain.dto.BoardDTO">
select equipment_code equCode,
equipment_name equName
from base_equipment
where equipment_type_code = #{equipmentTypeCode}
and status = '1' and del_flag='0'
</select>
<select id="getProduction15Days" resultType="com.op.mes.domain.MesReportWork">
select sum(mrw.quantity_feedback) quantityFeedback,
pow.product_date productDate,
pow.quantity_split quantity
from mes_report_work mrw
left join pro_order_workorder pow on pow.workorder_code = mrw.workorder_code
where mrw.del_flag='0' and pow.del_flag='0' and mrw.parent_order = '0'
and pow.workorder_name = #{equCode}
and CONVERT(DATE, pow.product_date) BETWEEN DATEADD(DAY, -15, CONVERT(DATE, GETDATE())) AND CONVERT(DATE, GETDATE())
group by pow.product_date,pow.quantity_split
</select>
</mapper>

@ -868,8 +868,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
work_time = #{item.workTime},
use_man = #{item.useMan},
update_by = #{item.updateBy},
update_time = #{item.updateTime},
remark = #{item.remark}
update_time = #{item.updateTime}
where
id = #{item.id}
</foreach>
@ -886,6 +885,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
set attr2 = '1'
where parent_order = #{workorderCode} and attr1= '1'
</update>
<update id="updateReportRemark">
<foreach collection="list" item="item" separator=";">
update mes_report_work set remark = #{item.remark}
where workorder_code = #{item.workorderCode}
</foreach>
</update>
<delete id="deleteMesReportWorkById" parameterType="String">
update mes_report_work set del_flag = '1' where id = #{id}

@ -60,7 +60,12 @@
</select>
<select id="selectMesUnitPriceByProCode" parameterType="MesUnitPrice" resultMap="MesUnitPriceResult">
<include refid="selectMesUnitPriceVo"/>
where product_code = #{productCode} and childprocess_code = #{childprocessCode}
<where>
<if test="factoryId != null ">and factory_id = #{factoryId}</if>
<if test="productCode != null and productCode != ''">and product_code = #{productCode}</if>
<if test="lineCode != null and lineCode != ''">and line_code = #{lineCode}</if>
<if test="childprocessCode != null and childprocessCode != ''">and childprocess_code = #{childprocessCode}</if>
</where>
</select>
<insert id="insertMesUnitPrice" parameterType="MesUnitPrice">

@ -379,7 +379,7 @@ public class OpenServiceImpl implements OpenService {
QcMaterialGroupDetailDTO group = openMapper.getGroupByMaterial(qcCheckTaskProduce.getMaterialCode());
if (group == null) {
group = new QcMaterialGroupDetailDTO();
group.setGroupId("3dc0655fea3449c59c76a01cc5b91565");
group.setGroupId("3dc0655fea3449c59c76a01cc5b91565");//成品蚊香物料组
}
qctp.setGroupId(group.getGroupId());//共性
List<QcCheckTaskDetailDTO> itemsGG = openMapper.getTPByTypeGroup(qctp);

@ -1,5 +1,6 @@
package com.op.quality.controller;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.utils.StringUtils;
import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcInterface;

@ -52,6 +52,15 @@ public class QcInterface extends BaseEntity {
private String nameDate;
private List<String> dataBarArrays;
private List<String> dataLineArrays;
private String equipmentTypeCode;
public String getEquipmentTypeCode() {
return equipmentTypeCode;
}
public void setEquipmentTypeCode(String equipmentTypeCode) {
this.equipmentTypeCode = equipmentTypeCode;
}
public List<String> getDataBarArrays() {
return dataBarArrays;

@ -37,4 +37,5 @@ public interface IQcInterfaceService {
List<QcInterface> getMonthOfYearContrast(QcInterface qcInterface);
QcLineChartDto getLineQcData(QcInterface qcInterface);
}

@ -667,8 +667,10 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
}
}
}
n= qcCheckTaskIncomeMapper.addQcCheckTaskDefects(defects);
logger.info("qc_check_task_defect:"+n);
if(!CollectionUtils.isEmpty(defects)){
n= qcCheckTaskIncomeMapper.addQcCheckTaskDefects(defects);
logger.info("qc_check_task_defect:"+n);
}
if("material".equals(qcCheckTaskIncome.getTypeCode())){
qcCheckTaskIncome.setCheckResult(result.equals("Y")?"1":"2");
@ -720,7 +722,7 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
n = qcCheckUnqualifiedMapper.insertQcCheckUnqualified(unqualified);
logger.info("qc_check_unqualified:" + n);
}
return n ;
return 1 ;
}
@Override

@ -95,9 +95,7 @@ public class BaseEquipmentController extends BaseController {
public AjaxResult add(@RequestBody BaseEquipment baseEquipment) {
if (baseEquipmentService.checkEquipmentCodeUnique(baseEquipment)) {
return AjaxResult.error("设备编码已存在!");
} else if (baseEquipmentService.checkEquipmentNameUnique(baseEquipment)) {
return AjaxResult.error("设备名称已存在!");
} else {
}else{
return toAjax(baseEquipmentService.insertBaseEquipment(baseEquipment));
}
}

Loading…
Cancel
Save