Merge remote-tracking branch 'origin/master'

highway
wws 1 year ago
commit 25f6ff4211

@ -24,6 +24,10 @@ public interface RemoteSapService {
@PostMapping("/sap/shopOrderSync") @PostMapping("/sap/shopOrderSync")
public R<List<SapProOrder>> shopOrderSync(@RequestBody SapShopOrderQuery sapProOrder); public R<List<SapProOrder>> shopOrderSync(@RequestBody SapShopOrderQuery sapProOrder);
/**传递母订单号和母订单数量**/
@PostMapping("/sap/shopUpdateSync")
public R shopUpdateSync(@RequestBody SapShopOrderQuery sapProOrder);
@PostMapping("/sap/sapRouterSync") @PostMapping("/sap/sapRouterSync")
public R<Boolean> sapRouterSync(@RequestBody SapRouterQuery sapRouterQuery); public R<Boolean> sapRouterSync(@RequestBody SapRouterQuery sapRouterQuery);

@ -7,6 +7,7 @@ import com.op.system.api.model.SapProOrder;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import java.util.List; import java.util.List;
@ -73,6 +74,11 @@ public class RemoteSapFallbackFactory implements FallbackFactory<RemoteSapServic
return R.fail("sap bom同步失败" + throwable.getMessage()); return R.fail("sap bom同步失败" + throwable.getMessage());
} }
@Override
public R shopUpdateSync(SapShopOrderQuery sapProOrder) {
return R.fail("sap shopUpdateSync失败" + throwable.getMessage());
}
}; };
} }

@ -1,5 +1,6 @@
package com.op.plan.service.impl; package com.op.plan.service.impl;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
@ -279,6 +280,20 @@ public class ProOrderServiceImpl implements IProOrderService {
if("0".equals(workOrder.getParentOrder())){ if("0".equals(workOrder.getParentOrder())){
//20231127,加入belongWorkOrder概念 //20231127,加入belongWorkOrder概念
belongWorkOrder = workOrder.getWorkorderCode(); belongWorkOrder = workOrder.getWorkorderCode();
//推送sap订单更新信息
SapShopOrderQuery sapChange = new SapShopOrderQuery();
sapChange.setAufnr(proOrder.getOrderCode());//母订单号
BigDecimal newSapQuantityNum = new BigDecimal(proOrder.getQuantity())
.subtract(new BigDecimal(proOrder.getQuantitySplit()));
sapChange.setQuantity(newSapQuantityNum.toString());//母订单新数量
logger.info("母订单"+proOrder.getOrderCode()+
"订单数量变更:修改前"+proOrder.getQuantity()+","+
",已拆数量"+proOrder.getQuantitySplit()+","+
"给sap汇报数量"+newSapQuantityNum.toString());
R rSapChange = remoteSapService.shopUpdateSync(sapChange);//sap只能同步指定日期的数据
logger.info("母订单"+proOrder.getOrderCode()+
"订单数量变更结果:"+rSapChange.getCode()+","+rSapChange.getMsg());
} }
workOrder.setBelongWorkOrder(belongWorkOrder); workOrder.setBelongWorkOrder(belongWorkOrder);

@ -23,6 +23,7 @@ import com.op.system.api.domain.dto.MesPrepareDTO;
import com.op.system.api.domain.dto.MesPrepareDetailDTO; import com.op.system.api.domain.dto.MesPrepareDetailDTO;
import com.op.system.api.domain.sap.SapCreateOrder; import com.op.system.api.domain.sap.SapCreateOrder;
import com.op.system.api.domain.sap.SapMaterialPreparation; import com.op.system.api.domain.sap.SapMaterialPreparation;
import com.op.system.api.domain.sap.SapShopOrderQuery;
import net.bytebuddy.matcher.FilterableList; import net.bytebuddy.matcher.FilterableList;
import org.apache.commons.collections4.ListUtils; import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
@ -36,6 +37,7 @@ import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -759,6 +761,23 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
Long conver = 1L; Long conver = 1L;
int index = workOrderList.size(); int index = workOrderList.size();
while (run) { while (run) {
if(StringUtils.isBlank(proOrder.getParentOrder())){
//推送sap订单更新信息
SapShopOrderQuery sapChange = new SapShopOrderQuery();
sapChange.setAufnr(proOrder.getOrderCode());//母订单号
BigDecimal newSapQuantityNum = new BigDecimal(proOrder.getQuantity())
.subtract(new BigDecimal(proOrder.getAtrr1()));
sapChange.setQuantity(newSapQuantityNum.toString());//母订单新数量
logger.info("母订单"+proOrder.getOrderCode()+
"订单数量变更:修改前"+proOrder.getQuantity()+","+
"已拆数量"+proOrder.getAtrr1()+","+
"给sap汇报数量"+newSapQuantityNum.toString());
R rSapChange = remoteSapService.shopUpdateSync(sapChange);//sap只能同步指定日期的数据
logger.info("母订单"+proOrder.getOrderCode()+
"订单数量变更结果:"+rSapChange.getCode()+","+rSapChange.getMsg());
}
// 获得对应工单 // 获得对应工单
ProOrderWorkorder proOrderWorkorder = workOrderList.get(--index); ProOrderWorkorder proOrderWorkorder = workOrderList.get(--index);
// 更新订单 // 更新订单

@ -7,7 +7,10 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.op.common.core.domain.ExcelCol; import com.op.common.core.domain.ExcelCol;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.poi.ExcelMapUtil; import com.op.common.core.utils.poi.ExcelMapUtil;
import com.op.common.security.utils.SecurityUtils;
import com.op.system.api.domain.SysUser;
import com.op.wms.domain.EquSpareEquipment; import com.op.wms.domain.EquSpareEquipment;
import com.op.wms.domain.WmsSparePartsLedger; import com.op.wms.domain.WmsSparePartsLedger;
import com.op.wms.service.IBaseEquipmentService; import com.op.wms.service.IBaseEquipmentService;
@ -114,7 +117,6 @@ public class BaseEquipmentController extends BaseController {
/** /**
* *
*/ */
// @RequiresPermissions("wms:equipment:getEquipmentTypeList")
@GetMapping("/getEquipmentTypeList") @GetMapping("/getEquipmentTypeList")
public TableDataInfo getEquipmentTypeList(BaseEquipment baseEquipment) { public TableDataInfo getEquipmentTypeList(BaseEquipment baseEquipment) {
List<BaseEquipment> list = baseEquipmentService.getEquipmentTypeList(baseEquipment); List<BaseEquipment> list = baseEquipmentService.getEquipmentTypeList(baseEquipment);
@ -125,8 +127,8 @@ public class BaseEquipmentController extends BaseController {
* *
*/ */
@GetMapping("/getSparePartsList") @GetMapping("/getSparePartsList")
public TableDataInfo getSparePartsList(BaseEquipment baseEquipment) { public TableDataInfo getSparePartsList(WmsSparePartsLedger wmsSparePartsLedger) {
List<WmsSparePartsLedger> list = baseEquipmentService.getSparePartsList(baseEquipment); List<WmsSparePartsLedger> list = baseEquipmentService.getSparePartsList(wmsSparePartsLedger);
return getDataTable(list); return getDataTable(list);
} }
@ -218,4 +220,14 @@ public class BaseEquipmentController extends BaseController {
return baseEquipmentService.importFile(orderList); return baseEquipmentService.importFile(orderList);
} }
/**
*
*/
@RequiresPermissions("wms:equipment:edit")
@Log(title = "修改设备状态", businessType = BusinessType.UPDATE)
@PutMapping("/changeStatus")
public AjaxResult changeStatus(@RequestBody BaseEquipment baseEquipment) {
return toAjax(baseEquipmentService.updateBaseEquipmentStatus(baseEquipment));
}
} }

@ -61,7 +61,7 @@ public class BaseEquipment extends BaseEntity {
private String workshopName; private String workshopName;
/** 设备状态 */ /** 设备状态 */
@Excel(name = "设备状态") @Excel(name = "设备是否启用")
private String status; private String status;
/** 预留字段1 */ /** 预留字段1 */
@ -207,6 +207,10 @@ public class BaseEquipment extends BaseEntity {
@Excel(name = "工厂号") @Excel(name = "工厂号")
private String factoryCode; private String factoryCode;
/** 设备状态 */
@Excel(name = "设备状态")
private String equipmentStatus;
private String imageFileList; private String imageFileList;
private String barCodeFileList; private String barCodeFileList;
@ -619,6 +623,14 @@ public class BaseEquipment extends BaseEntity {
return factoryCode; return factoryCode;
} }
//设备状态
public void setEquipmentStatus(String equipmentStatus) {
this.equipmentStatus = equipmentStatus;
}
public String getEquipmentStatus() {
return equipmentStatus;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -81,7 +81,7 @@ public interface BaseEquipmentMapper {
Long getEquipmentId(String equipmentCode); Long getEquipmentId(String equipmentCode);
//查询备件 //查询备件
List<WmsSparePartsLedger> getSparePartsList(BaseEquipment baseEquipment); List<WmsSparePartsLedger> getSparePartsList(WmsSparePartsLedger wmsSparePartsLedger);
//绑定备品备件 //绑定备品备件
public int bindSpareParts(EquSpareEquipment equSpareEquipment); public int bindSpareParts(EquSpareEquipment equSpareEquipment);
@ -107,4 +107,7 @@ public interface BaseEquipmentMapper {
//设备 //设备
BaseEquipment selectExistByEquipmentCode(String equipmentCode); BaseEquipment selectExistByEquipmentCode(String equipmentCode);
//更新设备状态
Integer updateBaseEquipmentStatus(BaseEquipment baseEquipment);
} }

@ -69,11 +69,14 @@ public interface IBaseEquipmentService {
List<BaseEquipment> getEquipmentTypeList(BaseEquipment baseEquipment); List<BaseEquipment> getEquipmentTypeList(BaseEquipment baseEquipment);
//查询设备备品备件 //查询设备备品备件
List<WmsSparePartsLedger> getSparePartsList(BaseEquipment baseEquipment); List<WmsSparePartsLedger> getSparePartsList(WmsSparePartsLedger wmsSparePartsLedger);
//查询设备备品备件右侧列表 //查询设备备品备件右侧列表
public List<EquSpareEquipment> getRightSparePartsList(BaseEquipment baseEquipment); public List<EquSpareEquipment> getRightSparePartsList(BaseEquipment baseEquipment);
//导入设备基础数据文件 //导入设备基础数据文件
AjaxResult importFile(List<BaseEquipment> equipmentList); AjaxResult importFile(List<BaseEquipment> equipmentList);
//更改设备状态
int updateBaseEquipmentStatus(BaseEquipment baseEquipment);
} }

@ -372,8 +372,8 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
*/ */
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public List<WmsSparePartsLedger> getSparePartsList(BaseEquipment baseEquipment) { public List<WmsSparePartsLedger> getSparePartsList(WmsSparePartsLedger wmsSparePartsLedger) {
return baseEquipmentMapper.getSparePartsList(baseEquipment); return baseEquipmentMapper.getSparePartsList(wmsSparePartsLedger);
} }
/** /**
@ -481,4 +481,19 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
return failEquipment; return failEquipment;
} }
/**
*
*
* @param baseEquipment
* @return
*/
@Override
@DS("#header.poolName")
public int updateBaseEquipmentStatus(BaseEquipment baseEquipment) {
baseEquipment.setUpdateBy(SecurityUtils.getUsername());
baseEquipment.setUpdateTime(DateUtils.getNowDate());
Integer list = baseEquipmentMapper.updateBaseEquipmentStatus(baseEquipment);
return list;
}
} }

@ -47,6 +47,7 @@
<result property="sapAsset" column="sap_asset" /> <result property="sapAsset" column="sap_asset" />
<result property="equipmentHead" column="equipment_head" /> <result property="equipmentHead" column="equipment_head" />
<result property="factoryCode" column="factory_code" /> <result property="factoryCode" column="factory_code" />
<result property="equipmentStatus" column="equipment_status" />
</resultMap> </resultMap>
<resultMap type="WmsSparePartsLedger" id="WmsSparePartsLedgerResult"> <resultMap type="WmsSparePartsLedger" id="WmsSparePartsLedgerResult">
@ -159,7 +160,9 @@
asset_head, asset_head,
fixed_asset_code, fixed_asset_code,
department, department,
equipment_head equipment_head,
factory_code,
equipment_status
from base_equipment from base_equipment
</sql> </sql>
@ -201,6 +204,7 @@
<if test="department != null and department != ''"> and department = #{department}</if> <if test="department != null and department != ''"> and department = #{department}</if>
<if test="sapAsset != null and sapAsset != ''"> and sap_asset = #{sapAsset}</if> <if test="sapAsset != null and sapAsset != ''"> and sap_asset = #{sapAsset}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if> <if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="equipmentStatus != null and equipmentStatus != ''"> and equipment_status = #{equipmentStatus}</if>
and del_flag ='0' and del_flag ='0'
</where> </where>
</select> </select>
@ -254,6 +258,7 @@
<if test="sapAsset != null">sap_asset,</if> <if test="sapAsset != null">sap_asset,</if>
<if test="equipmentHead != null">equipment_head,</if> <if test="equipmentHead != null">equipment_head,</if>
<if test="factoryCode != null">factory_code,</if> <if test="factoryCode != null">factory_code,</if>
<if test="equipmentStatus != null">equipment_status,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="equipmentCode != null and equipmentCode != ''">#{equipmentCode},</if> <if test="equipmentCode != null and equipmentCode != ''">#{equipmentCode},</if>
@ -296,6 +301,7 @@
<if test="sapAsset != null">#{sapAsset},</if> <if test="sapAsset != null">#{sapAsset},</if>
<if test="equipmentHead != null">#{equipmentHead},</if> <if test="equipmentHead != null">#{equipmentHead},</if>
<if test="factoryCode != null">#{factoryCode},</if> <if test="factoryCode != null">#{factoryCode},</if>
<if test="equipmentStatus != null">equipmentStatus,</if>
</trim> </trim>
</insert> </insert>
@ -342,6 +348,7 @@
<if test="sapAsset != null">sap_asset = #{sapAsset},</if> <if test="sapAsset != null">sap_asset = #{sapAsset},</if>
<if test="equipmentHead != null">equipment_head = #{equipmentHead},</if> <if test="equipmentHead != null">equipment_head = #{equipmentHead},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if> <if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="equipmentStatus != null">equipment_status = #{equipmentStatus},</if>
</trim> </trim>
where equipment_id = #{equipmentId} where equipment_id = #{equipmentId}
</update> </update>
@ -514,4 +521,12 @@
and del_flag ='0' and del_flag ='0'
</select> </select>
<update id="updateBaseEquipmentStatus" parameterType="BaseEquipment">
update base_equipment
<trim prefix="SET" suffixOverrides=",">
<if test="status != null">status = #{status},</if>
</trim>
where equipment_id = #{equipmentId}
</update>
</mapper> </mapper>
Loading…
Cancel
Save