Merge remote-tracking branch 'origin/master'

master
mengjiao 11 months ago
commit 764e94276f

@ -218,6 +218,15 @@ public class BaseEquipmentDto extends BaseEntity {
private String plcPort;
private String ymd;
private String shiftId;
public String getShiftId() {
return shiftId;
}
public void setShiftId(String shiftId) {
this.shiftId = shiftId;
}
public String getYmd() {
return ymd;

@ -101,7 +101,7 @@ public interface MesMapper {
List<MesStationArrive> getUnChangeList(MesStationArrive dto);
List<MesShift> getChangeInfos(BaseEquipmentDto dto);
MesShift getChangeInfos(BaseEquipmentDto dto);
ProOrderWorkorderDTO getActOrderWork(MesStationArrive qo);

@ -646,7 +646,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
DynamicDataSourceContextHolder.push("ds_999");// 这是数据源的key
BaseEquipmentDto edto = new BaseEquipmentDto();
edto.setEquipmentTypeCode("equTypeCxj");
edto.setEquipmentTypeCode("equ_type_cxj");
List<BaseEquipmentDto> cxjList = mesMapper.getAllEquipments(edto);
ExecutorService executorService = new ThreadPoolExecutor(
cxjList.size(),
@ -655,10 +655,10 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
new LinkedBlockingQueue<Runnable>());
try {
cxjList.forEach(cxj -> {
if(cxj.getEquipmentCode().equals("C4")){
//if(cxj.getEquipmentCode().equals("C5")){
Runnable run = () -> changeTransferResultFunc(cxj);
executorService.execute(run);
}
//}
});
} catch (Exception e) {
logger.error("service == changeTransferResultTask == exception", e);
@ -675,18 +675,43 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
*/
private R changeTransferResultFunc(BaseEquipmentDto cxj){
logger.info("++++++++++++" + cxj.getEquipmentCode() + "++++班次交接最后一车数据修正++++++++++");
DynamicDataSourceContextHolder.push("ds_999");// 这是数据源的key
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); // 定义日期格式
LocalDate today = LocalDate.now();
String ymdT0 = today.format(formatter); // 格式化今天的日期
LocalDate qianDay = today.minusDays(2);
String qianDayStr = qianDay.format(formatter); // 格式化前天的日期
LocalDate yesterday = today.minusDays(1);
String ymd = yesterday.format(formatter); // 格式化昨天的日期
cxj.setYmd("'"+ymdT0+"','"+ymd+"'");
List<MesShift> changeInfos = mesMapper.getChangeInfos(cxj);
String yesterdayStr = yesterday.format(formatter); // 格式化昨天的日期
List<MesShift> changeInfos = new ArrayList<>();
//昨天的白班开始
cxj.setYmd(qianDayStr);
cxj.setShiftId("2");
MesShift changeInfo0 = mesMapper.getChangeInfos(cxj);
changeInfo0.setShiftId(5);//昨天的白班
changeInfos.add(changeInfo0);
//昨天的白班结束 昨天的夜班开始
cxj.setYmd(yesterdayStr);
cxj.setShiftId("5");
MesShift changeInfo1 = mesMapper.getChangeInfos(cxj);
changeInfo1.setShiftId(2);//昨天的夜班
changeInfos.add(changeInfo1);
//昨天的白班结束 昨天的夜班开始
cxj.setYmd(yesterdayStr);
cxj.setShiftId("2");
MesShift changeInfo2 = mesMapper.getChangeInfos(cxj);
changeInfos.add(changeInfo2);
if(CollectionUtils.isEmpty(changeInfos)){
logger.info("++++++++++++班次交接最后一车数据修正:无数据++++++++++"+JSONObject.toJSONString(cxj));
return R.fail("班次交接最后一车数据修正:无数据");
}
List<MesStationArrive> todoList = new ArrayList<>();
if(changeInfos.size()<3){
logger.info("++++++++++++班次交接最后一车数据修正:修正点缺失(必须三个点)++++++++++");
return R.fail("班次交接最后一车数据修正:无数据");
}
for(int m=0;m<changeInfos.size()-1;m++){
Date startTime = changeInfos.get(m).getStartTime();
Date endTime = changeInfos.get(m+1).getStartTime();
@ -698,17 +723,12 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
qo.setStationNo(cxj.getEquipmentCode());//成型机编码
logger.info("++++++++++++班次交接最后一车数据修正:开始修正++++++++++"+JSONObject.toJSONString(qo));
List<MesStationArrive> todos1 = mesMapper.getUnChangeList(qo);//需要调整的数据
todoList.addAll(todos1);
if(!CollectionUtils.isEmpty(todoList)){
continue;
}
qo.setReqCode(ymd);//工单日期
qo.setReqCode(yesterdayStr);//工单日期
ProOrderWorkorderDTO actOrderWork = mesMapper.getActOrderWork(qo);
if(actOrderWork != null){//给需要调整的数据重新赋值新的班次工单Id
Date nowDate = DateUtils.getNowDate();
for(MesStationArrive newtodo:todoList){
for(MesStationArrive newtodo:todos1){
newtodo.setChangeOrderWorkId(actOrderWork.getWorkorderId());
newtodo.setShiftId(Integer.parseInt(actOrderWork.getShiftId()));
newtodo.setChangeWorkDate(actOrderWork.getProductDate());
@ -716,10 +736,10 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
}
}
/**mes_material_transfer_result**/
int n = mesMapper.updateTransferResult(todoList);
logger.info("++++++++++++班次交接最后一车数据修正:修正成功"+n+"++++++++++"+JSONObject.toJSONString(todoList));
int n = mesMapper.updateTransferResult(todos1);
logger.info("++++++++++++班次交接最后一车数据修正:班次"+changeInfos.get(m).getShiftId()+"修正成功"
+n+"++++++++++"+JSONObject.toJSONString(todos1));
}
logger.info("++++++++++++班次交接最后一车数据修正:数据条数++++++++++"+todoList.size());
return R.fail("班次交接最后一车数据修正:完成");
}

@ -430,14 +430,12 @@
and shift_id != #{shiftId}
</select>
<select id="getChangeInfos" resultType="com.op.mes.domain.MesShift">
select * from(
select shift_code shiftId,min(change_time) startTime,work_date,device_code deviceCode
from mes_changeshift_info
where device_code = #{equipmentCode}
<!--and CONVERT(varchar(10),change_time, 120) in (${ymd})-->
and work_date in (${ymd})
group by shift_code,work_date,device_code
) t order by t.startTime
select top 1 shift_code shiftId,
change_time startTime,
work_date,
device_code deviceCode
from mes_changeshift_info
where work_date =#{ymd} and shift_code = #{shiftId} and device_code = #{equipmentCode} order by change_time desc
</select>
<select id="getActOrderWork" resultType="com.op.system.api.domain.mes.ProOrderWorkorderDTO">
select top 1 workorder_id workorderId,

@ -76,6 +76,14 @@ public class QcProjectTypeController extends BaseController {
return toAjax(qcProjectTypeService.insertQcProjectType(qcProjectType));
}
/**
*
*/
@GetMapping("/projectTypeTree")
public AjaxResult projectTypeTree (QcProjectType qcProjectType) {
return success(qcProjectTypeService.selectProjectTypeTree(qcProjectType));
}
/**
*
*/

@ -5,6 +5,9 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import java.util.ArrayList;
import java.util.List;
/**
* qc_project_type
*
@ -57,6 +60,8 @@ public class QcProjectType extends BaseEntity {
private String productGroupName;
private String productGroup;
private List<QcProjectType> children = new ArrayList<>();
public String getProductGroupName() {
return productGroupName;
}
@ -145,6 +150,14 @@ public class QcProjectType extends BaseEntity {
this.version = version;
}
public List<QcProjectType> getChildren() {
return children;
}
public void setChildren(List<QcProjectType> children) {
this.children = children;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -3,6 +3,7 @@ package com.op.quality.domain.vo;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.op.quality.domain.QcGoal;
import com.op.quality.domain.QcMaterialGroup;
import com.op.quality.domain.QcProjectType;
import javax.xml.bind.annotation.XmlEnum;
@ -50,6 +51,12 @@ public class TreeSelect implements Serializable {
this.children = qcGoal.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
}
public TreeSelect(QcProjectType projectType) {
this.id = projectType.getProjectTypeCode();
this.label = projectType.getProjectTypeName();
this.children = projectType.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
}
public String getId() {
return id;
}

@ -3,6 +3,7 @@ package com.op.quality.service;
import java.util.List;
import com.op.quality.domain.QcProjectType;
import com.op.quality.domain.vo.TreeSelect;
/**
* Service
@ -58,4 +59,6 @@ public interface IQcProjectTypeService {
* @return
*/
public int deleteQcProjectTypeById(String id);
List<TreeSelect> selectProjectTypeTree(QcProjectType qcProjectType);
}

@ -617,7 +617,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
}
@Override
//@Transactional(rollbackFor = Exception.class)
@Transactional(rollbackFor = Exception.class)
public int commitCheckResults(QcCheckTaskIncome qcCheckTaskIncome) {
List<QcCheckTaskDetail> details = qcCheckTaskIncome.getQcCheckTaskDetails();
@ -821,11 +821,11 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
List<SysNoticeGroup> notices = qcCheckTaskIncomeMapper.getNoticesGroup(noticeQo);
if(!CollectionUtils.isEmpty(notices)) {
List<WechartDTO> wecharts = new ArrayList<>();
//去主库查微信id
DynamicDataSourceContextHolder.push("master");// 这是数据源的key
List<String> userCodes = notices.stream()
.map(SysNoticeGroup::getUserCode)
.collect(Collectors.toList());
// //去主库查微信id
// DynamicDataSourceContextHolder.push("master");// 这是数据源的key
// List<String> userCodes = notices.stream()
// .map(SysNoticeGroup::getUserCode)
// .collect(Collectors.toList());
//Map<String, SysUser> wxidsMap = qcCheckTaskIncomeMapper.getWxIdMap(userCodes);
for (SysNoticeGroup noticedto : notices) {
// SysUser sysUser = wxidsMap.get(noticedto.getUserCode());

@ -1,11 +1,15 @@
package com.op.quality.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.SpringUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.vo.TreeSelect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.quality.mapper.QcProjectTypeMapper;
@ -106,4 +110,23 @@ public class QcProjectTypeServiceImpl implements IQcProjectTypeService {
public int deleteQcProjectTypeById(String id) {
return qcProjectTypeMapper.deleteQcProjectTypeById(id);
}
@Override
public List<TreeSelect> selectProjectTypeTree(QcProjectType qcProjectType) {
List<QcProjectType> qcProjectTypeList = SpringUtils.getAopProxy(this).selectQcProjectTypeList(qcProjectType);
return buildProjectTreeSelect(qcProjectTypeList);
}
private List<TreeSelect> buildProjectTreeSelect(List<QcProjectType> qcProjectTypeList) {
// 根节点
QcProjectType rootTree = new QcProjectType();
rootTree.setProjectTypeCode("projectType0");
rootTree.setProjectTypeName("检验方案");
// 设置二级节点
rootTree.setChildren(qcProjectTypeList);
// 因为只有二层,直接构造树
List<QcProjectType> projectTypeTree = new ArrayList<>();
projectTypeTree.add(rootTree);
return projectTypeTree.stream().map(TreeSelect::new).collect(Collectors.toList());
}
}

@ -50,7 +50,7 @@
<if test="attr1 != null and attr1 != ''">and attr1 = #{attr1}</if>
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
<if test="judge != null and judge != ''">and judge = #{judge}</if>
<if test="projectType != null and projectType != ''">project_type = #{projectType}</if>
<if test="projectType != null and projectType != ''">and project_type = #{projectType}</if>
and del_flag = '0'
</where>
order by create_time

@ -69,7 +69,7 @@ public class BaseProductAttachedController extends BaseController {
/**
*
*/
@RequiresPermissions("wms:attached:add")
@RequiresPermissions("wms:attached:edit")
@Log(title = "物料附属信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BaseProductAttached baseProductAttached) {

@ -20,6 +20,8 @@ public class BaseProduct extends BaseEntity {
* ID
*/
private String productId;
//附属属性表id
private String id;
/**
*
@ -481,11 +483,17 @@ public class BaseProduct extends BaseEntity {
public void setProductId(String productId) {
this.productId = productId;
}
public String getProductId() {
return productId;
}
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}

@ -2,9 +2,11 @@ package com.op.wms.service.impl;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.wms.mapper.BaseProductAttachedMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.wms.mapper.BaseProductAttachedMapper;
import com.op.wms.domain.BaseProductAttached;
import com.op.wms.service.IBaseProductAttachedService;
@ -26,6 +28,7 @@ public class BaseProductAttachedServiceImpl implements IBaseProductAttachedServi
* @return
*/
@Override
@DS("#header.poolName")
public BaseProductAttached selectBaseProductAttachedById(String id) {
return baseProductAttachedMapper.selectBaseProductAttachedById(id);
}
@ -37,6 +40,7 @@ public class BaseProductAttachedServiceImpl implements IBaseProductAttachedServi
* @return
*/
@Override
@DS("#header.poolName")
public List<BaseProductAttached> selectBaseProductAttachedList(BaseProductAttached baseProductAttached) {
return baseProductAttachedMapper.selectBaseProductAttachedList(baseProductAttached);
}
@ -48,7 +52,9 @@ public class BaseProductAttachedServiceImpl implements IBaseProductAttachedServi
* @return
*/
@Override
@DS("#header.poolName")
public int insertBaseProductAttached(BaseProductAttached baseProductAttached) {
baseProductAttached.setId(IdUtils.fastSimpleUUID());
return baseProductAttachedMapper.insertBaseProductAttached(baseProductAttached);
}
@ -59,6 +65,7 @@ public class BaseProductAttachedServiceImpl implements IBaseProductAttachedServi
* @return
*/
@Override
@DS("#header.poolName")
public int updateBaseProductAttached(BaseProductAttached baseProductAttached) {
return baseProductAttachedMapper.updateBaseProductAttached(baseProductAttached);
}
@ -70,6 +77,7 @@ public class BaseProductAttachedServiceImpl implements IBaseProductAttachedServi
* @return
*/
@Override
@DS("#header.poolName")
public int deleteBaseProductAttachedByIds(String[] ids) {
return baseProductAttachedMapper.deleteBaseProductAttachedByIds(ids);
}
@ -81,6 +89,7 @@ public class BaseProductAttachedServiceImpl implements IBaseProductAttachedServi
* @return
*/
@Override
@DS("#header.poolName")
public int deleteBaseProductAttachedById(String id) {
return baseProductAttachedMapper.deleteBaseProductAttachedById(id);
}

@ -84,8 +84,8 @@
<if test="productCode != null">product_code,</if>
<if test="category != null">category,</if>
<if test="pc != null">pc,</if>
<if test="iei != null">iei,</if>
<if test="manStandar != null">man_standar,</if>
iei,
man_standar,
<if test="sprayWay != null">spray_way,</if>
<if test="blankDiameter != null">blank_diameter,</if>
<if test="blankNo != null">blank_no,</if>
@ -104,8 +104,8 @@
<if test="productCode != null">#{productCode},</if>
<if test="category != null">#{category},</if>
<if test="pc != null">#{pc},</if>
<if test="iei != null">#{iei},</if>
<if test="manStandar != null">#{manStandar},</if>
#{iei},
#{manStandar},
<if test="sprayWay != null">#{sprayWay},</if>
<if test="blankDiameter != null">#{blankDiameter},</if>
<if test="blankNo != null">#{blankNo},</if>
@ -121,27 +121,35 @@
</trim>
</insert>
<!-- <update id="updateBaseProductAttached" parameterType="BaseProductAttached">-->
<!-- update base_product_attached-->
<!-- <trim prefix="SET" suffixOverrides=",">-->
<!-- <if test="productCode != null">product_code = #{productCode},</if>-->
<!-- <if test="category != null">category = #{category},</if>-->
<!-- <if test="pc != null">pc = #{pc},</if>-->
<!-- <if test="iei != null">iei = #{iei},</if>-->
<!-- <if test="manStandar != null">man_standar = #{manStandar},</if>-->
<!-- <if test="sprayWay != null">spray_way = #{sprayWay},</if>-->
<!-- <if test="blankDiameter != null">blank_diameter = #{blankDiameter},</if>-->
<!-- <if test="blankNo != null">blank_no = #{blankNo},</if>-->
<!-- <if test="sprayVolume != null">spray_volume = #{sprayVolume},</if>-->
<!-- <if test="liquidNo != null">liquid_no = #{liquidNo},</if>-->
<!-- <if test="endometrialDosage != null">endometrial_dosage = #{endometrialDosage},</if>-->
<!-- <if test="outerFilmDosage != null">outer_film_dosage = #{outerFilmDosage},</if>-->
<!-- <if test="support != null">support = #{support},</if>-->
<!-- <if test="supportNo != null">support_no = #{supportNo},</if>-->
<!-- <if test="pvc != null">pvc = #{pvc},</if>-->
<!-- <if test="supportPlate != null">support_plate = #{supportPlate},</if>-->
<!-- <if test="other != null">other = #{other},</if>-->
<!-- </trim>-->
<!-- where id = #{id}-->
<!-- </update>-->
<update id="updateBaseProductAttached" parameterType="BaseProductAttached">
update base_product_attached
<trim prefix="SET" suffixOverrides=",">
<if test="productCode != null">product_code = #{productCode},</if>
<if test="category != null">category = #{category},</if>
<if test="pc != null">pc = #{pc},</if>
<if test="iei != null">iei = #{iei},</if>
<if test="manStandar != null">man_standar = #{manStandar},</if>
<if test="sprayWay != null">spray_way = #{sprayWay},</if>
<if test="blankDiameter != null">blank_diameter = #{blankDiameter},</if>
<if test="blankNo != null">blank_no = #{blankNo},</if>
<if test="sprayVolume != null">spray_volume = #{sprayVolume},</if>
<if test="liquidNo != null">liquid_no = #{liquidNo},</if>
<if test="endometrialDosage != null">endometrial_dosage = #{endometrialDosage},</if>
<if test="outerFilmDosage != null">outer_film_dosage = #{outerFilmDosage},</if>
<if test="support != null">support = #{support},</if>
<if test="supportNo != null">support_no = #{supportNo},</if>
<if test="pvc != null">pvc = #{pvc},</if>
<if test="supportPlate != null">support_plate = #{supportPlate},</if>
<if test="other != null">other = #{other},</if>
</trim>
set
iei = #{iei},
man_standar = #{manStandar}
where id = #{id}
</update>

@ -65,6 +65,8 @@
<result property="supportPlate" column="support_plate"/>
<result property="other" column="other"/>
<result property="reportRate" column="report_rate"/>
<!--附属属性-->
<result property="id" column="id"/>
</resultMap>
<sql id="selectBaseProductVo">
@ -163,6 +165,7 @@
bp.append_percent,
bp.mtart,
bp.report_rate,
bpa.id,
bpa.category,
bpa.pc,
bpa.iei,

Loading…
Cancel
Save