问题清单处理1.0

master
zhaoxiaolin 10 months ago
parent 3dc156131b
commit 5676606f68

@ -664,6 +664,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where mrw.parent_order = '0'
and mrw.workorder_code = #{workorderCode}
and mrw.del_flag = '0' and po.del_flag = '0'
order by mrw.batch
</select>
<select id="getSonWorkOrder" resultType="com.op.mes.domain.ProOrderWorkorder">
select workorder_code workorderCode,

@ -77,7 +77,7 @@ public interface OpenMapper {
public int addBatch(@Param("list") List<QcCheckTaskDetailDTO> items);
List<QcUserMaterialDTO> getUserByMaterial(String materialCode);
List<QcUserMaterialDTO> getCheckUsers(String materialCode);
public int addCheckUsers(@Param("list") List<QcUserMaterialDTO> users);
}

@ -346,7 +346,7 @@ public class OpenServiceImpl implements OpenService {
qctp.setMaterialCode(qcCheckTaskProduce.getMaterialCode());//特性
/**qc_user_material取默认检查人**/
List<QcUserMaterialDTO> users = openMapper.getUserByMaterial(qcCheckTaskProduce.getMaterialCode());
List<QcUserMaterialDTO> users = openMapper.getCheckUsers(qcCheckTaskProduce.getOrderNo());
if (CollectionUtils.isEmpty(users)) {
QcUserMaterialDTO dto0 = new QcUserMaterialDTO();
dto0.setId(IdUtils.fastSimpleUUID());

@ -195,10 +195,12 @@
and qctp.type_id = #{typeId}
order by qctp.sort
</select>
<select id="getUserByMaterial" resultType="com.op.system.api.domain.quality.QcUserMaterialDTO">
select user_code userCode,
user_name userName
from qc_user_material where material_code = #{materialCode}
<select id="getCheckUsers" resultType="com.op.system.api.domain.quality.QcUserMaterialDTO">
select qum.user_code userCode,
qum.user_name userName
from qc_user_material qum
left join pro_order_workorder pow on pow.workorder_code = qum.material_code
where pow.workorder_code = #{workorderCode} and pow.del_flag = '0' and qum.del_flag = '0'
</select>
<insert id="insertEquRepairOrder" parameterType="DeviceRepairOrder">

@ -286,6 +286,8 @@ public class ProOrderController extends BaseController {
}
/**
* workorderIds
*
*
*/
@RequiresPermissions("mes:pro:order:edit")
@Log(title = "关闭订单", businessType = BusinessType.OTHER)

@ -234,4 +234,6 @@ public interface ProOrderMapper {
void updateOrderStatusCompleteByOrderCode(String orderCode);
void addSapLog(SysSapLog sysSapLog);
int updateCloseOrderBatchById(@Param("orderIds")String[] orderIds);
}

@ -192,5 +192,7 @@ public interface ProOrderWorkorderMapper {
int deletePrepareDetailBatch(@Param("workorders")List<String> workorders);
List<String> getOrderNotW0(@Param("workorderCodes") String[] workorderCodes);
List<ProOrderWorkorder> getOrderByOrders(@Param("orderIds") String[] orderIds);
}

@ -1093,7 +1093,16 @@ public class ProOrderServiceImpl implements IProOrderService {
@DS("#header.poolName")
@Transactional(rollbackFor = Exception.class)
public int deleteOrder(String[] orderIds) {
//可以进行订单关闭的数据
//未拆分,直接关闭订单
List<ProOrderWorkorder> checkOrders = proOrderWorkorderMapper.getOrderByOrders(orderIds);
if(!CollectionUtils.isEmpty(checkOrders)){
int m0 = proOrderMapper.deleteProOrderByIds(orderIds);
logger.info(orderIds[0]+"删除订单m0:"+m0);
return 1;
}
//已经存在工单可以进行订单关闭的数据
List<ProOrderWorkorder> checkWorkOrders = proOrderWorkorderMapper.getWorkOrderByOrders(orderIds);
if(checkWorkOrders.size() != orderIds.length){
return 2;
@ -1138,33 +1147,27 @@ public class ProOrderServiceImpl implements IProOrderService {
closeR.getCode()+","+
closeR.getMsg()+","+
closeR.getData());
//if(closeR.getCode()==200){
String[] workorderIds = (String[]) delteIds.toArray(new String[delteIds.size()]);
if (workorderIds.length > 0) {
//删除工单(字母)pro_order_workorder
int m1 = proOrderWorkorderMapper.deleteProOrderWorkorderByWorkorderIds(workorderIds);
logger.info(workorderCodes.get(0)+"删除订单m1:"+m1);
//删除批次pro_order_workorder_batch
int m2 = proOrderWorkorderBatchMapper.deleteBatch(workorderIds);
logger.info(workorderCodes.get(0)+"删除订单m2:"+m2);
//删除领料单mes_prepare
int m3 = proOrderWorkorderMapper.deletePrepareBatch(workorderCodes);
logger.info(workorderCodes.get(0)+"删除订单m3:"+m3);
//删除领料单明细mes_prepare_detail
int m4 = proOrderWorkorderMapper.deletePrepareDetailBatch(workorderCodes);
logger.info(workorderCodes.get(0)+"删除订单m4:"+m4);
}
String[] workorderIds = (String[]) delteIds.toArray(new String[delteIds.size()]);
if (workorderIds.length > 0) {
//删除工单(字母)pro_order_workorder
int m1 = proOrderWorkorderMapper.deleteProOrderWorkorderByWorkorderIds(workorderIds);
logger.info(workorderCodes.get(0)+"删除订单m1:"+m1);
//删除批次pro_order_workorder_batch
int m2 = proOrderWorkorderBatchMapper.deleteBatch(workorderIds);
logger.info(workorderCodes.get(0)+"删除订单m2:"+m2);
//删除领料单mes_prepare
int m3 = proOrderWorkorderMapper.deletePrepareBatch(workorderCodes);
logger.info(workorderCodes.get(0)+"删除订单m3:"+m3);
//删除领料单明细mes_prepare_detail
int m4 = proOrderWorkorderMapper.deletePrepareDetailBatch(workorderCodes);
logger.info(workorderCodes.get(0)+"删除订单m4:"+m4);
}
if (!CollectionUtils.isEmpty(workers)) {
//删除订单pro_order
int m5 = proOrderMapper.updateCloseOrderBatch(workers);
logger.info(workorderCodes.get(0)+"删除订单m5:"+m5);
}
// }else{
// logger.info(workorder.getWorkorderCode()+"删除订单后关闭订单sap返回结果"+
// JSONObject.toJSONString(closeR));
// return 0;
// }
if (!CollectionUtils.isEmpty(workers)) {
//删除订单pro_order
int m5 = proOrderMapper.updateCloseOrderBatch(workers);
logger.info(workorderCodes.get(0)+"删除订单m5:"+m5);
}
}
return 1;
}

@ -379,6 +379,14 @@
<update id="updateOrderStatusCompleteByOrderCode">
update pro_order set status = 'o2' where parent_order = #{orderCode} and del_flag = '0'
</update>
<update id="updateCloseOrderBatchById">
update pro_order
set del_flag = '1'
where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<delete id="deleteProOrderById" parameterType="String">
update pro_order

@ -534,6 +534,15 @@
and pow.status in ('w0')
and pow.del_flag = '0'
</select>
<select id="getOrderByOrders" resultType="com.op.plan.domain.ProOrderWorkorder">
select status,id
from pro_order
where id in
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
#{orderId}
</foreach>
and status in ('o1','o0') and del_flag = '0'
</select>
<insert id="createPrepareDetails">
insert into mes_prepare_detail

@ -74,6 +74,8 @@ public class QcCheckTaskDefect extends BaseEntity {
@Excel(name = "检验任务id")
private String belongTo;
private String belongToDetail;
/**
*
*/
@ -86,6 +88,14 @@ public class QcCheckTaskDefect extends BaseEntity {
@Excel(name = "不合格数量")
private BigDecimal noOkQuality;
public String getBelongToDetail() {
return belongToDetail;
}
public void setBelongToDetail(String belongToDetail) {
this.belongToDetail = belongToDetail;
}
public void setRecordId(String recordId) {
this.recordId = recordId;
}

@ -135,6 +135,33 @@ public class QcCheckTaskDetail extends BaseEntity {
private String fileListStr;
private List<BaseFile> files;
private List<String> fileUrls;
private String defectCodes;
private String defectNames;
private String defectQualitys;
public String getDefectCodes() {
return defectCodes;
}
public void setDefectCodes(String defectCodes) {
this.defectCodes = defectCodes;
}
public String getDefectNames() {
return defectNames;
}
public void setDefectNames(String defectNames) {
this.defectNames = defectNames;
}
public String getDefectQualitys() {
return defectQualitys;
}
public void setDefectQualitys(String defectQualitys) {
this.defectQualitys = defectQualitys;
}
public List<String> getFileUrls() {
return fileUrls;

@ -90,6 +90,8 @@ public interface QcCheckTaskIncomeMapper {
List<QcUserMaterialDTO> getUserByMaterial(String materialCode);
List<QcUserMaterialDTO> getCheckUsers(String orderNo);
int addCheckUsers(@Param("list") List<QcUserMaterialDTO> users);
int addQcCheckTaskDefects(@Param("list") List<QcCheckTaskDefect> defects);

@ -19,10 +19,7 @@ import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -215,6 +212,7 @@ public class QcCheckReportProduceServiceImpl implements IQcCheckReportProduceSer
if(StringUtils.isNotBlank(produce.getIncomeBatchNo())){
List<String> batchNos = Arrays.asList(produce.getIncomeBatchNo().split(";"));
List<String> disBatchNos = batchNos.stream().distinct().collect(Collectors.toList());
Collections.sort(disBatchNos);
produce.setIncomeBatchNo(StringUtils.join(disBatchNos, ";"));
}

@ -214,7 +214,7 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
qcCheckTaskIncome.setCheckManName("");
qcCheckTaskIncome.setCheckManCode("");
/**qc_user_material取默认检查人**/
List<QcUserMaterialDTO> users = qcCheckTaskIncomeMapper.getUserByMaterial(qcCheckTaskIncome.getMaterialCode());
List<QcUserMaterialDTO> users = qcCheckTaskIncomeMapper.getCheckUsers(qcCheckTaskIncome.getOrderNo());
if(CollectionUtils.isEmpty(users)){
QcUserMaterialDTO dto0 = new QcUserMaterialDTO();
dto0.setId(IdUtils.fastSimpleUUID());
@ -599,7 +599,7 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
break;
}
}
//TODO;today
int n = 0;
QcCheckTaskIncome qcCheckTask = new QcCheckTaskIncome();
qcCheckTask.setUpdateBy(updateBy);

@ -176,23 +176,6 @@ public class QcCheckTaskInventoryServiceImpl implements IQcCheckTaskInventorySer
}
//检验人插入
qcCheckTaskUserService.insertQcCheckTaskUserList(qcCheckTaskUserList);
} else {//上位机
qcCheckTaskInventory.setCheckManName("");
qcCheckTaskInventory.setCheckManCode("");
/**qc_user_material取默认检查人**/
List<QcUserMaterialDTO> users = qcCheckTaskIncomeMapper.getUserByMaterial(qcCheckTaskInventory.getMaterialCode());
if (!CollectionUtils.isEmpty(users)) {
for (QcUserMaterialDTO user : users) {
user.setId(IdUtils.fastSimpleUUID());
user.setBelongTo(beLongId);
user.setCheckNo(qcCheckTaskInventory.getCheckNo());
user.setCreateBy(createBy);
user.setFactoryCode(factoryCode);
user.setCreateTime(nowDate);
}
int m = qcCheckTaskIncomeMapper.addCheckUsers(users);
logger.info("检查人新增" + m + "成功");
}
}
/** 不良品数据插入 */
BigDecimal noOkQuality = new BigDecimal(0);

@ -173,23 +173,6 @@ public class QcCheckTaskMarketServiceImpl implements IQcCheckTaskMarketService {
}
//检验人插入
qcCheckTaskUserService.insertQcCheckTaskUserList(qcCheckTaskUserList);
} else {//上位机
qcCheckTaskMarket.setCheckManName("");
qcCheckTaskMarket.setCheckManCode("");
/**qc_user_material取默认检查人**/
List<QcUserMaterialDTO> users = qcCheckTaskIncomeMapper.getUserByMaterial(qcCheckTaskMarket.getMaterialCode());
if (!CollectionUtils.isEmpty(users)) {
for (QcUserMaterialDTO user : users) {
user.setId(IdUtils.fastSimpleUUID());
user.setBelongTo(beLongId);
user.setCheckNo(qcCheckTaskMarket.getCheckNo());
user.setCreateBy(createBy);
user.setFactoryCode(factoryCode);
user.setCreateTime(nowDate);
}
int m = qcCheckTaskIncomeMapper.addCheckUsers(users);
logger.info("检查人新增" + m + "成功");
}
}
/** 不良品数据插入 */
if(qcCheckTaskMarket.getNoOkQuality()==null){

@ -204,7 +204,7 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
qcCheckTaskProduce.setCheckManName("");
qcCheckTaskProduce.setCheckManCode("");
/**qc_user_material取默认检查人**/
List<QcUserMaterialDTO> users = qcCheckTaskIncomeMapper.getUserByMaterial(qcCheckTaskProduce.getMaterialCode());
List<QcUserMaterialDTO> users = qcCheckTaskIncomeMapper.getCheckUsers(qcCheckTaskProduce.getOrderNo());
if(!CollectionUtils.isEmpty(users)){
for(QcUserMaterialDTO user:users){
user.setId(IdUtils.fastSimpleUUID());

@ -338,9 +338,16 @@
</foreach>
</select>
<select id="getUserByMaterial" resultType="com.op.system.api.domain.quality.QcUserMaterialDTO">
select user_code userCode,
user_name userName
from qc_user_material where material_code = #{materialCode}
select user_code userCode,
user_name userName
from qc_user_material where material_code = #{materialCode}
</select>
<select id="getCheckUsers" resultType="com.op.system.api.domain.quality.QcUserMaterialDTO">
select qum.user_code userCode,
qum.user_name userName
from qc_user_material qum
left join pro_order_workorder pow on pow.workorder_code = qum.material_code
where pow.workorder_code = #{orderNo} and pow.del_flag = '0' and qum.del_flag = '0'
</select>
<select id="getCkeckDefectList" resultType="com.op.quality.domain.QcCheckTaskDefect">
select

Loading…
Cancel
Save