报工+批次可以重复+其它细节功能改善2

master
zhaoxiaolin 10 months ago
parent 53cc4a78b5
commit 29c2ca8448

@ -157,9 +157,15 @@ public class RyTask {
/************质量管理系统定时任务开始*****************/
//过程巡检每3分钟执行检查一次
public void createProduceXJTask(){
logger.info("++质量管理系统+过程巡检+开始++createProduceXJTask+++++");
logger.info("++质量管理系统+过程巡检任务创建+开始++createProduceXJTask+++++");
remoteQualityService.createProduceXJTask();
}
//来料检验批量检验任务创建每30分钟执行一次
public void createIncomeBatchTask(){
logger.info("++质量管理系统+来料检验任务创建+开始++createIncomeBatchTask+++++");
remoteQualityService.createIncomeBatchTask();
}
/************质量管理系统定时任务结束*****************/
/************hr 人力基础数据定时任务开始*****************/
@ -182,12 +188,5 @@ public class RyTask {
}
/************部门基础数据定时任务开始*****************/
/************质量管理系统-来料检验批量检验任务创建-定时任务开始*****************/
//来料检验批量检验任务创建每30分钟执行一次
public void createIncomeBatchTask(){
logger.info("++质量管理系统+来料检验批量检验任务创建+开始++createIncomeBatchTask+++++");
remoteQualityService.createIncomeBatchTask();
}
/************质量管理系统-来料检验批量检验任务创建-定时任务结束*****************/
}

@ -80,5 +80,7 @@ public interface OpenMapper {
List<QcUserMaterialDTO> getCheckUsers(String checkType);
public int addCheckUsers(@Param("list") List<QcUserMaterialDTO> users);
String getSampNum(QcCheckTaskProduceDTO sampQua);
}

@ -372,24 +372,33 @@ public class OpenServiceImpl implements OpenService {
int m = openMapper.addCheckUsers(users);
logger.info(qcCheckTaskProduce.getOrderNo()+":检查人新增" + m + "成功");
/**qc_check_type_project**/
/**qc_check_type_project**///个性
List<QcCheckTaskDetailDTO> items = openMapper.getTPByTypeMaterial(qctp);
if (CollectionUtils.isEmpty(items)) {
/**qc_material_group_detail**/
QcMaterialGroupDetailDTO group = openMapper.getGroupByMaterial(qcCheckTaskProduce.getMaterialCode());
if (group == null) {
logger.info(qcCheckTaskProduce.getOrderNo()+":"+qcCheckTaskProduce.getMaterialCode()+"没有维护物料组检测项,检验任务生成失败");
return 0;//没有找到检测项目
}
qctp.setGroupId(group.getGroupId());//共性
items = openMapper.getTPByTypeGroup(qctp);
/**qc_material_group_detail**/
QcMaterialGroupDetailDTO group = openMapper.getGroupByMaterial(qcCheckTaskProduce.getMaterialCode());
if (group == null) {
group = new QcMaterialGroupDetailDTO();
group.setGroupId("3dc0655fea3449c59c76a01cc5b91565");
}
qctp.setGroupId(group.getGroupId());//共性
List<QcCheckTaskDetailDTO> itemsGG = openMapper.getTPByTypeGroup(qctp);
items.addAll(itemsGG);
/**qc_check_task_detail**/
if (CollectionUtils.isEmpty(items)) {
return 0;//没有找到检测项目
}
/**qc_sample_rule**/
QcCheckTaskProduceDTO sampQua = new QcCheckTaskProduceDTO();
sampQua.setCheckType(qcCheckTaskProduce.getCheckType());
sampQua.setQuality(qcCheckTaskProduce.getQuality());
String sampNum = openMapper.getSampNum(sampQua);
if(StringUtils.isNotBlank(sampNum)){
qcCheckTaskProduce.setSampleQuality(new BigDecimal(sampNum));
}
/**qc_check_task**/
qcCheckTaskProduce.setRecordId(beLongId);
qcCheckTaskProduce.setFactoryCode(factoryCode);

@ -201,6 +201,12 @@
from qc_user_material qum
where qum.material_code = #{checkType} and pow.del_flag = '0' and qum.del_flag = '0'
</select>
<select id="getSampNum" resultType="java.lang.String">
select sample_quality
from qc_sample_rule
where end_value>= #{quality} and #{quality}>=start_value and del_flag = '0'
and check_type = #{checkType}
</select>
<insert id="insertEquRepairOrder" parameterType="DeviceRepairOrder">
insert into equ_repair_order

@ -292,7 +292,6 @@ public class ProOrderController extends BaseController {
return proOrderService.syncSAPOrders();
}
/**
* workorderIds
*
*
*/

@ -197,5 +197,9 @@ public interface ProOrderWorkorderMapper {
List<ProOrderWorkorder> getOrderByOrders(@Param("orderIds") String[] orderIds);
List<String> checkBatchCodes(@Param("batchs") List<Batch> formFields);
List<ProOrderWorkorder> getUnSplitOrder(@Param("orderIds") String[] orderIds);
ProOrderWorkorder selectSonOrder(String parentOrder);
}

@ -1094,10 +1094,27 @@ public class ProOrderServiceImpl implements IProOrderService {
@Transactional(rollbackFor = Exception.class)
public int deleteOrder(String[] orderIds) {
//未拆分,直接关闭订单
//未拆分、部分拆分,直接关闭订单
List<ProOrderWorkorder> checkOrders = proOrderWorkorderMapper.getOrderByOrders(orderIds);
if(!CollectionUtils.isEmpty(checkOrders)){
int m0 = proOrderMapper.deleteProOrderByIds(orderIds);
List<String> allOrderIds = new ArrayList<>();
for(ProOrderWorkorder order:checkOrders){
String topOrderCode = order.getOrderCode();
allOrderIds.add(order.getOrderId());
Boolean run = true;
while (run) {
//下级
ProOrderWorkorder sonOrder = proOrderWorkorderMapper.selectSonOrder(topOrderCode);
//有下级code
if (sonOrder != null) {
allOrderIds.add(sonOrder.getOrderId());
topOrderCode = sonOrder.getOrderCode();
} else {
run = false;
}
}
}
int m0 = proOrderMapper.deleteProOrderByIds(allOrderIds.toArray(new String[allOrderIds.size()]));
logger.info(orderIds[0]+"删除订单m0:"+m0);
return 1;
}
@ -1107,6 +1124,7 @@ public class ProOrderServiceImpl implements IProOrderService {
if(checkWorkOrders.size() != orderIds.length){
return 2;
}
for(ProOrderWorkorder workorder:checkWorkOrders){
//要删除的工单id们
List<String> delteIds = new ArrayList<>();
@ -1178,7 +1196,7 @@ public class ProOrderServiceImpl implements IProOrderService {
if(!CollectionUtils.isEmpty(repeatBatchCodes)){
return StringUtils.join(repeatBatchCodes, ",");
}
return "";
return "";
}
public static void main(String args[]){

@ -535,7 +535,7 @@
and pow.del_flag = '0'
</select>
<select id="getOrderByOrders" resultType="com.op.plan.domain.ProOrderWorkorder">
select status,id
select status,id orderId,order_code orderCode
from pro_order
where id in
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
@ -551,6 +551,26 @@
#{batch.batchCode}
</foreach>
</select>
<select id="getUnSplitOrder" resultType="com.op.plan.domain.ProOrderWorkorder">
select
order_code orderCode,
id orderId
from pro_order po
where po.id in
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
#{orderId}
</foreach>
and po.status in ('o0')
and po.del_flag = '0'
</select>
<select id="selectSonOrder" resultType="com.op.plan.domain.ProOrderWorkorder">
select order_code orderCode,
id orderId,
parent_order parentOrder
from pro_order po
where po.parent_order = #{parentOrder}
and po.del_flag = '0'
</select>
<insert id="createPrepareDetails">
insert into mes_prepare_detail

@ -150,22 +150,17 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
QcCheckTypeProject qctp= new QcCheckTypeProject();
qctp.setTypeId(qcCheckTaskIncome.getCheckType());//生产过程检验
qctp.setMaterialCode(qcCheckTaskIncome.getMaterialCode());//特性
/**qc_check_type_project**/
/**qc_check_type_project**///个性
List<QcCheckTaskDetail> items = qcCheckTypeProjectMapper.getTPByTypeMaterial(qctp);
/**qc_material_group_detail**/
//个性
QcMaterialGroupDetail group = qcMaterialGroupDetailMapper.getGroupByMaterial(qcCheckTaskIncome.getMaterialCode());
// if(group == null){
// return 0;//没有找到检测项目
// }
if(Objects.isNull(group)){
return 0;//没有找到检测项目
}
//共性
if(group == null){//默认
group = new QcMaterialGroupDetail();
group.setGroupId("729971295b734782b544f9d6d06fb8b9");
}
qctp.setGroupId(group.getGroupId());
List<QcCheckTaskDetail> itemsGG = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp);
items.addAll(itemsGG);
/**qc_check_task_detail**/

@ -27,6 +27,7 @@ import com.op.quality.service.IQcCheckTaskUserService;
import com.op.system.api.RemoteUserService;
import com.op.system.api.domain.SysUser;
import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
import com.op.system.api.domain.quality.QcMaterialGroupDetailDTO;
import com.op.system.api.domain.quality.QcUserMaterialDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -158,17 +159,18 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
QcCheckTypeProject qctp= new QcCheckTypeProject();
qctp.setTypeId(qcCheckTaskProduce.getCheckType());//生产过程检验
qctp.setMaterialCode(qcCheckTaskProduce.getMaterialCode());//特性
/**qc_check_type_project**/
/**qc_check_type_project**///个性
List<QcCheckTaskDetail> items = qcCheckTypeProjectMapper.getTPByTypeMaterial(qctp);
if(CollectionUtils.isEmpty(items)){
/**qc_material_group_detail**/
QcMaterialGroupDetail group = qcMaterialGroupDetailMapper.getGroupByMaterial(qcCheckTaskProduce.getMaterialCode());
if(group == null){
return 0;//没有找到检测项目
}
qctp.setGroupId(group.getGroupId());//共性
items = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp);
/**qc_material_group_detail**/
QcMaterialGroupDetail group = qcMaterialGroupDetailMapper.getGroupByMaterial(qcCheckTaskProduce.getMaterialCode());
if(group == null){
group = new QcMaterialGroupDetail();
group.setGroupId("3dc0655fea3449c59c76a01cc5b91565");
}
qctp.setGroupId(group.getGroupId());//共性
List<QcCheckTaskDetail> itemsGG = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp);
items.addAll(itemsGG);
/**qc_check_task_detail**/
if(CollectionUtils.isEmpty(items)){

Loading…
Cancel
Save