定时任务:
1、定时同步原材料入库、原材料出库、成品入库和成品出库过滤出单位信息为空的数据(主要是测试数据)
2、增加物料自动出库的定时任务
3、增加生成生产计划明细完成的工时信息情况
master
xs 4 months ago
parent 35bd9fa6cc
commit a1fd2a6573

@ -223,4 +223,15 @@ public interface RemoteMesService {
*/
@GetMapping("/purchaseOrder/selectPurchaseOrderJoinSupplierProjectByOrderId/{purchaseOrderId}")
public R<MesPurchaseOrder> selectPurchaseOrderJoinSupplierProjectByOrderId(@PathVariable("purchaseOrderId") Long purchaseOrderId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
*
*
* @param source
* @return
*/
@PostMapping("/productplan/generateProduceStatisticsDetail")
public R<?> generateProduceStatisticsDetail(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}

@ -297,6 +297,8 @@ public class MesPurchaseOrder extends BaseEntity {
private Long materialBomId;
private String orderStatusStr;
public Long getSerialNumber() {
return serialNumber;
@ -770,6 +772,14 @@ public class MesPurchaseOrder extends BaseEntity {
this.materialBomId = materialBomId;
}
public String getOrderStatusStr() {
return orderStatusStr;
}
public void setOrderStatusStr(String orderStatusStr) {
this.orderStatusStr = orderStatusStr;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -121,6 +121,12 @@ public class RemoteMesFallbackFactory implements FallbackFactory<RemoteMesServic
public R<MesPurchaseOrder> selectPurchaseOrderJoinSupplierProjectByOrderId(Long purchaseOrderId, String source) {
return R.fail("根据采购订单ID获取采购订单信息失败:" + throwable.getMessage());
}
@Override
public R<?> generateProduceStatisticsDetail(String source) {
return R.fail("定时生成完成的生产明细失败:" + throwable.getMessage());
}
};
}
}

@ -236,6 +236,8 @@ public class MesConstants {
*/
public static final String MES_PURCHASE_ORDER_STATUS_TOPURCHASE = "1";//待采购
public static final String MES_PURCHASE_ORDER_STATUS_PURCHASEING = "2";//采购中
public static final String MES_PURCHASE_ORDER_STATUS_PURCHASE_COMPLETE = "3";//采购完成
public static final String MES_PURCHASE_ORDER_STATUS_AUTO_OUTSTOCK_COMPLETE = "4";//自动出库完成
@ -254,16 +256,21 @@ public class MesConstants {
*
*/
public static final String MES_SALE_ORDER_IS_RELEASE_TO_PUBLISH = "0";//待发布工单
public static final String MES_SALE_ORDER_IS_RELEASE_PUBLISHED = "1";//已发布工单
public static final String MES_SALE_ORDER_IS_RELEASE_BEGIN = "2";//已开始
public static final String MES_SALE_ORDER_IS_RELEASE_FINISH = "3";//已完成
/**
* :1ERP2
*/
public static final String MES_PURCHASE_ORDER_CLASSFICATION_ERP= "1"; //ERP同步采购订单
public static final String MES_PURCHASE_ORDER_CLASSFICATION_VIRTUAL= "2"; //虚拟采购订单
/**
* :1ERP2
*/
public static final String MES_SALE_ORDER_CLASSFICATION_ERP= "1"; //ERP同步销售订单
public static final String MES_SALE_ORDER_CLASSFICATION_VIRTUAL= "2"; //虚拟销售订单
@ -317,4 +324,8 @@ public class MesConstants {
/**生产告警信息处理状态*/
public static final String MES_ALARM_INFO_HANDLE_STATUS_NO= "0";//未处理
public static final String MES_ALARM_INFO_HANDLE_STATUS_YES= "1";//已处理
/**生产工单派工类型*/
public static final String MES_PRODUCT_ORDER_DISPATCH_TYPE_PRODUCE="1";//产线
public static final String MES_PRODUCT_ORDER_DISPATCH_TYPE_ROUTE="2";//工艺路线
}

@ -168,4 +168,9 @@ public enum BusinessType
* 使
*/
USE,
/**
*
*/
OVERTIME,
}

@ -152,10 +152,22 @@ public class RyTask
}
/**
*
* @param dateStr
*/
public void autoOutstock(String dateStr){
if (StringUtils.isEmpty(dateStr)) {
dateStr = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, new Date());
}
remoteMesService.autoOutstockLastPurchaseOrders(dateStr,SecurityConstants.INNER);
}
/**
*
*/
public void generateProduceStatisticsDetail(){
remoteMesService.generateProduceStatisticsDetail(SecurityConstants.INNER);
}
}

@ -78,4 +78,22 @@ public class MesImportController extends BaseController {
return success(message);
}
/**
* BOMexcel
* @param file
* @param updateSupport
* @return
*/
@Log(title = "提资单BOM信息", businessType = BusinessType.IMPORT)
@PostMapping(("/raiseCapitalImportDataTest"))
public AjaxResult raiseCapitalImportDataTest(MultipartFile file, boolean updateSupport)
{
String operName = SecurityUtils.getUsername();
String message = mesImportService.raiseCapitalImportDataTest(file, updateSupport, operName);
return success(message);
}
}

@ -0,0 +1,105 @@
package com.hw.mes.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType;
import com.hw.common.security.annotation.RequiresPermissions;
import com.hw.mes.domain.MesProduceStatisticsDetail;
import com.hw.mes.service.IMesProduceStatisticsDetailService;
import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.common.core.utils.poi.ExcelUtil;
import com.hw.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author xins
* @date 2024-11-26
*/
@RestController
@RequestMapping("/produceStatisticsDetail")
public class MesProduceStatisticsDetailController extends BaseController
{
@Autowired
private IMesProduceStatisticsDetailService mesProduceStatisticsDetailService;
/**
*
*/
@RequiresPermissions("mes:produceStatisticsDetail:list")
@GetMapping("/list")
public TableDataInfo list(MesProduceStatisticsDetail mesProduceStatisticsDetail)
{
startPage();
List<MesProduceStatisticsDetail> list = mesProduceStatisticsDetailService.selectMesProduceStatisticsDetailJoinList(mesProduceStatisticsDetail);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("mes:produceStatisticsDetail:export")
@Log(title = "生产完成明细", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MesProduceStatisticsDetail mesProduceStatisticsDetail)
{
List<MesProduceStatisticsDetail> list = mesProduceStatisticsDetailService.selectMesProduceStatisticsDetailList(mesProduceStatisticsDetail);
ExcelUtil<MesProduceStatisticsDetail> util = new ExcelUtil<MesProduceStatisticsDetail>(MesProduceStatisticsDetail.class);
util.exportExcel(response, list, "生产完成明细数据");
}
/**
*
*/
@RequiresPermissions("mes:produceStatisticsDetail:query")
@GetMapping(value = "/{statisticsDetailId}")
public AjaxResult getInfo(@PathVariable("statisticsDetailId") Long statisticsDetailId)
{
return success(mesProduceStatisticsDetailService.selectMesProduceStatisticsDetailByStatisticsDetailId(statisticsDetailId));
}
/**
*
*/
@RequiresPermissions("mes:produceStatisticsDetail:add")
@Log(title = "生产完成明细", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MesProduceStatisticsDetail mesProduceStatisticsDetail)
{
return toAjax(mesProduceStatisticsDetailService.insertMesProduceStatisticsDetail(mesProduceStatisticsDetail));
}
/**
*
*/
@RequiresPermissions("mes:produceStatisticsDetail:edit")
@Log(title = "生产完成明细", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MesProduceStatisticsDetail mesProduceStatisticsDetail)
{
return toAjax(mesProduceStatisticsDetailService.updateMesProduceStatisticsDetail(mesProduceStatisticsDetail));
}
/**
*
*/
@RequiresPermissions("mes:produceStatisticsDetail:remove")
@Log(title = "生产完成明细", businessType = BusinessType.DELETE)
@DeleteMapping("/{statisticsDetailIds}")
public AjaxResult remove(@PathVariable Long[] statisticsDetailIds)
{
return toAjax(mesProduceStatisticsDetailService.deleteMesProduceStatisticsDetailByStatisticsDetailIds(statisticsDetailIds));
}
}

@ -3,6 +3,7 @@ package com.hw.mes.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.hw.common.core.domain.R;
import com.hw.common.core.utils.StringUtils;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.domain.MesSaleOrder;
@ -217,4 +218,20 @@ public class MesProductOrderController extends BaseController {
return toAjax(mesProductOrderService.productOrderContinue(mesProductOrder));
}
/**
*
*/
@Log(title = "生产工单", businessType = BusinessType.OVERTIME)
@PostMapping("/productOrderOverTimeAlarm")
// @InnerAuth
public R<?> productOrderOverTimeAlarm() {
try {
mesProductOrderService.productOrderOverTimeAlarm();
return R.ok();
} catch (Exception e) {
e.printStackTrace();
return R.fail(e.getMessage());
}
}
}

@ -66,6 +66,17 @@ public class MesProductPlanController extends BaseController {
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("mes:productplan:list")
@GetMapping("/joinList")
public TableDataInfo joinList(MesProductPlan mesProductPlan) {
startPage();
List<MesProductPlan> list = mesProductPlanService.selectMesProductPlanJoinUserList(mesProductPlan);
return getDataTable(list);
}
/**
* List
*

@ -288,4 +288,22 @@ public class MesPurchaseOrderController extends BaseController
return R.ok(mesPurchaseOrder);
}
/**
*
*/
@Log(title = "采购订单", businessType = BusinessType.OVERTIME)
@PostMapping("/purchaseOrderOverTimeAlarm")
// @InnerAuth
public R<?> purchaseOrderOverTimeAlarm() {
try {
mesPurchaseOrderService.purchaseOrderOverTimeAlarm();
return R.ok();
} catch (Exception e) {
e.printStackTrace();
return R.fail(e.getMessage());
}
}
}

@ -186,4 +186,23 @@ public class MesSaleOrderController extends BaseController {
List<MesSaleOrderRelate> list = mesSaleOrderService.getRelateProductsBySaleOrderId(saleOrderId);
return R.ok(list);
}
/**
*
*/
@Log(title = "销售订单", businessType = BusinessType.OVERTIME)
@PostMapping("/saleOrderOverTimeAlarm")
// @InnerAuth
public R<?> saleOrderOverTimeAlarm() {
try {
mesSaleOrderService.saleOrderOverTimeAlarm();
return R.ok();
} catch (Exception e) {
e.printStackTrace();
return R.fail(e.getMessage());
}
}
}

@ -25,6 +25,10 @@ public class MesProduceStatisticsDetail extends BaseEntity
@Excel(name = "生产工单ID")
private Long productOrderId;
private String dispatchType;
private Long dispatchId;
/** 销售订单ID */
@Excel(name = "销售订单ID")
private Long saleOrderId;
@ -82,22 +86,22 @@ public class MesProduceStatisticsDetail extends BaseEntity
private String processName;
/** 计划开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "计划开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date planBeginTime;
/** 计划结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "计划结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date planEndTime;
/** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date realBeginTime;
/** 完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date realEndTime;
@ -126,7 +130,24 @@ public class MesProduceStatisticsDetail extends BaseEntity
{
return productOrderId;
}
public void setSaleOrderId(Long saleOrderId)
public String getDispatchType() {
return dispatchType;
}
public void setDispatchType(String dispatchType) {
this.dispatchType = dispatchType;
}
public Long getDispatchId() {
return dispatchId;
}
public void setDispatchId(Long dispatchId) {
this.dispatchId = dispatchId;
}
public void setSaleOrderId(Long saleOrderId)
{
this.saleOrderId = saleOrderId;
}

@ -252,10 +252,14 @@ public class MesProductOrder extends BaseEntity {
*/
private List<String> planDateRange;
private String orderStatusStr;
private String overtimeFlag;//超时标识,用来查询使用
public List<String> getPlanDateRange() {
return planDateRange;
}
public void setPlanDateRange(List<String> planDateRange) {
this.planDateRange = planDateRange;
}
@ -575,6 +579,22 @@ public class MesProductOrder extends BaseEntity {
this.produceMaterialSpec = produceMaterialSpec;
}
public String getOrderStatusStr() {
return orderStatusStr;
}
public void setOrderStatusStr(String orderStatusStr) {
this.orderStatusStr = orderStatusStr;
}
public String getOvertimeFlag() {
return overtimeFlag;
}
public void setOvertimeFlag(String overtimeFlag) {
this.overtimeFlag = overtimeFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -202,6 +202,9 @@ public class MesProductPlan extends BaseEntity
private String materialClassfication;
private String dispatchType;
private Long dispatchId;
public Long getSaleOrderId() {
return saleOrderId;
@ -608,6 +611,22 @@ public class MesProductPlan extends BaseEntity
this.materialClassfication = materialClassfication;
}
public String getDispatchType() {
return dispatchType;
}
public void setDispatchType(String dispatchType) {
this.dispatchType = dispatchType;
}
public Long getDispatchId() {
return dispatchId;
}
public void setDispatchId(Long dispatchId) {
this.dispatchId = dispatchId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -201,6 +201,8 @@ public class MesSaleOrder extends BaseEntity {
private String parentIds;
private String isReleaseStr;
public String getMaterialModel() {
return materialModel;
@ -474,6 +476,14 @@ public class MesSaleOrder extends BaseEntity {
this.parentIds = parentIds;
}
public String getIsReleaseStr() {
return isReleaseStr;
}
public void setIsReleaseStr(String isReleaseStr) {
this.isReleaseStr = isReleaseStr;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -84,4 +84,13 @@ public interface MesProduceStatisticsDetailMapper
* @return
*/
public int deleteMesProduceStatisticsDetailMaterialByStatisticsDetailId(Long statisticsDetailId);
/**
* ,join material,process
*
* @param mesProduceStatisticsDetail
* @return
*/
public List<MesProduceStatisticsDetail> selectMesProduceStatisticsDetailJoinList(MesProduceStatisticsDetail mesProduceStatisticsDetail);
}

@ -153,5 +153,13 @@ public interface MesProductPlanMapper
*/
public MesProductPlan selectOnlyMesProductPlanByPlanId(Long planId);
/**
* ,Join user,material,process,productorder
*
* @param mesProductPlan
* @return
*/
public List<MesProductPlan> selectMesProductPlanJoinUserList(MesProductPlan mesProductPlan);
}

@ -1,6 +1,8 @@
package com.hw.mes.service;
import com.hw.common.core.exception.ServiceException;
import com.hw.mes.domain.MesPurchaseRequisitionTemplate;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@ -41,4 +43,15 @@ public interface IMesImportService
*/
String raiseCapitalImportData(MultipartFile file, boolean updateSupport, String operName);
/**
* BOMexcel
*
* @param file
* @param updateSupport
* @param operName
* @return
*/
public String raiseCapitalImportDataTest(MultipartFile file, boolean updateSupport, String operName);
}

@ -0,0 +1,69 @@
package com.hw.mes.service;
import java.util.List;
import com.hw.mes.domain.MesProduceStatisticsDetail;
/**
* Service
*
* @author xins
* @date 2024-11-26
*/
public interface IMesProduceStatisticsDetailService
{
/**
*
*
* @param statisticsDetailId
* @return
*/
public MesProduceStatisticsDetail selectMesProduceStatisticsDetailByStatisticsDetailId(Long statisticsDetailId);
/**
*
*
* @param mesProduceStatisticsDetail
* @return
*/
public List<MesProduceStatisticsDetail> selectMesProduceStatisticsDetailList(MesProduceStatisticsDetail mesProduceStatisticsDetail);
/**
* ,join material,process
*
* @param mesProduceStatisticsDetail
* @return
*/
public List<MesProduceStatisticsDetail> selectMesProduceStatisticsDetailJoinList(MesProduceStatisticsDetail mesProduceStatisticsDetail);
/**
*
*
* @param mesProduceStatisticsDetail
* @return
*/
public int insertMesProduceStatisticsDetail(MesProduceStatisticsDetail mesProduceStatisticsDetail);
/**
*
*
* @param mesProduceStatisticsDetail
* @return
*/
public int updateMesProduceStatisticsDetail(MesProduceStatisticsDetail mesProduceStatisticsDetail);
/**
*
*
* @param statisticsDetailIds
* @return
*/
public int deleteMesProduceStatisticsDetailByStatisticsDetailIds(Long[] statisticsDetailIds);
/**
*
*
* @param statisticsDetailId
* @return
*/
public int deleteMesProduceStatisticsDetailByStatisticsDetailId(Long statisticsDetailId);
}

@ -138,4 +138,9 @@ public interface IMesProductOrderService
* @param mesProductOrder
*/
public List<MesMaterialBom> getMaterialUsages(MesProductOrder mesProductOrder);
/**
*
*/
public void productOrderOverTimeAlarm();
}

@ -178,4 +178,13 @@ public interface IMesProductPlanService
* @return
*/
public int deleteProductPlansByDispatchCode(MesProductPlanDeleteVo mesProductPlanDeleteVo);
/**
* Join user,material,process,productorder
*
* @param mesProductPlan
* @return
*/
public List<MesProductPlan> selectMesProductPlanJoinUserList(MesProductPlan mesProductPlan);
}

@ -174,4 +174,9 @@ public interface IMesPurchaseOrderService
* @return
*/
public List<MesPurchaseOrder> selectBindPurchaseOrders(MesPurchaseOrder mesPurchaseOrder);
/**
*
*/
public void purchaseOrderOverTimeAlarm();
}

@ -121,4 +121,9 @@ public interface IMesSaleOrderService
* @return
*/
public int updateMesSaleOrderMaterials(List<MesSaleOrderMaterial> mesSaleOrderMaterialList);
/**
*
*/
public void saleOrderOverTimeAlarm();
}

@ -9,6 +9,7 @@ import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils;
import com.hw.common.core.utils.ip.IpUtils;
import com.hw.common.core.utils.uuid.Seq;
import com.hw.common.security.handler.GlobalExceptionHandler;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.*;
import com.hw.mes.config.MesConfig;
@ -20,6 +21,8 @@ import com.hw.wms.api.RemoteWmsService;
import com.hw.wms.api.domain.WmsWarehouseMaterial;
import com.hw.wms.api.domain.vo.WmsProductStockVo;
import com.hw.wms.api.domain.vo.WmsRawStockVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
@ -39,6 +42,8 @@ import java.util.stream.Collectors;
*/
@Service
public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService {
private static final Logger log = LoggerFactory.getLogger(MesBaseBarcodeInfoServiceImpl.class);
@Autowired
private MesBaseBarcodeInfoMapper mesBaseBarcodeInfoMapper;
@ -905,12 +910,14 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
//先根据之前的成品条码信息获取托盘信息
MesBaseBarcodeInfo productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(oriProductBarcode);
log.info("1:"+productBarcodeInfo.toString());
if (productBarcodeInfo == null) {
allErrorMsgBuilder.append("成品/配对码").append(oriProductBarcode).append("不存在;");
}
if(productBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_BIND)){
productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(productBarcodeInfo.getBindBarcode());
log.info("2:"+productBarcodeInfo.toString());
if (productBarcodeInfo == null) {
allErrorMsgBuilder.append("成品/配对码[").append(oriProductBarcode).append("]的成品不存在;");
}
@ -957,19 +964,29 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
materialId = this.insertNewVirtualMaterial(barcodeInfo,mergeMaterialName, userName, currentDate);
} else {
MesBasePalletInfo basePalletInfo = mesBasePalletInfoMapper.selectMesBasePalletInfoByBarcode(productBarcodes);
MesBaseBarcodeInfo productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(productBarcodes);
if (productBarcodeInfo == null) {
allErrorMsgBuilder.append("此成品/配对码不存在;");
}
if(productBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_BIND)){
productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(productBarcodeInfo.getBindBarcode());
log.info("2:"+productBarcodeInfo.toString());
if (productBarcodeInfo == null) {
allErrorMsgBuilder.append("成品/配对码[").append(productBarcodes).append("]的成品不存在;");
}
}
MesBasePalletInfo basePalletInfo = mesBasePalletInfoMapper.selectMesBasePalletInfoByBarcode(productBarcodeInfo.getBarcodeInfo());
if (basePalletInfo == null) {
allErrorMsgBuilder.append("此成品条码没有绑定托盘信息;");
} else {
palletInfoCode = basePalletInfo.getPalletInfoCode();
}
MesBaseBarcodeInfo productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(productBarcodes);
if (productBarcodeInfo == null) {
allErrorMsgBuilder.append("此成品条码不存在;");
}
allErrorMsgBuilder.append(this.checkInternalMesBaseBarcode(productBarcodes, productBarcodeInfo, mesBaseBarcodeInfo));
allErrorMsgBuilder.append(this.checkInternalMesBaseBarcode(productBarcodeInfo.getBarcodeInfo(), productBarcodeInfo, mesBaseBarcodeInfo));
productBarcodeInfoList.add(productBarcodeInfo);
basePalletInfoList.add(basePalletInfo);

@ -7,6 +7,8 @@ import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.ip.IpUtils;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseStationInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesBaseStationInfoMapper;
@ -23,6 +25,8 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
@Autowired
private MesBaseStationInfoMapper mesBaseStationInfoMapper;
private static final Logger log = LoggerFactory.getLogger(MesBaseStationInfoServiceImpl.class);
/**
*
*
@ -101,11 +105,12 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
*/
@Override
public MesBaseStationInfo getLoginStationInfo() {
String ipAddress = SecurityUtils.getLoginUser().getIpaddr();
String ipAddress = IpUtils.getIpAddr();
// ipAddress = "192.168.2.25";
log.info(ipAddress+"---"+SecurityUtils.getLoginUser().getIpaddr());
MesBaseStationInfo mesBaseStationInfo = mesBaseStationInfoMapper.selectMesBaseStationInfoByStationIp(ipAddress);
Integer processFloor = SecurityUtils.getProcessFloor();
Integer processFloor = SecurityUtils.getLoginUser().getProcessFloor();
if (mesBaseStationInfo != null && mesBaseStationInfo.getFloor() != null && !mesBaseStationInfo.getFloor().equals(processFloor)) {
throw new ServiceException("请在" + processFloor + "楼登录此工序");
}

@ -15,11 +15,10 @@ import com.hw.common.security.utils.SecurityUtils;
import com.hw.jindie.api.RemoteJindieService;
import com.hw.mes.api.RemoteMesService;
import com.hw.mes.api.domain.MesBaseMaterialInfo;
import com.hw.mes.api.domain.MesPurchaseOrder;
import com.hw.mes.domain.*;
import com.hw.mes.mapper.MesBaseMaterialInfoMapper;
import com.hw.mes.mapper.MesBaseUnitInfoMapper;
import com.hw.mes.mapper.MesMaterialBomMapper;
import com.hw.mes.mapper.*;
import com.hw.mes.service.*;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.util.IOUtils;
@ -68,6 +67,12 @@ public class MesImportImpl implements IMesImportService {
@Autowired
private IMesPurchaseApplyProcessService mesPurchaseApplyProcessService;
@Autowired
private MesSaleOrderMapper mesSaleOrderMapper;
@Autowired
private MesPurchaseOrderMapper mesPurchaseOrderMapper;
private static final Logger log = LoggerFactory.getLogger(MesImportImpl.class);
/**
@ -446,4 +451,175 @@ public class MesImportImpl implements IMesImportService {
return "导入成功";
}
/**
* BOMexcel
*
* @param file
* @param updateSupport
* @param operName
* @return
*/
@Override
@Transactional(rollbackFor = ServiceException.class)
public String raiseCapitalImportDataTest(MultipartFile file, boolean updateSupport, String operName) {
InputStream is = null;
StringBuilder failureMsg = new StringBuilder();
List<String> finishedProductNameList = new ArrayList<>();
try {
is = file.getInputStream();
Workbook workbook = new XSSFWorkbook(is);
Sheet sheet = workbook.getSheetAt(0);
int lastRowNum = sheet.getLastRowNum();
for (int i = 0; i < lastRowNum; i++) {
Row rowT = sheet.getRow(i);
if (rowT == null) {
continue; // 如果行为空,跳过
}
Cell cellT = rowT.getCell(0);
if (StringUtils.isNull(cellT)) {
throw new ServiceException("Excel格式错误");
}
String productBom = null;
String productName = "test";
switch (cellT.getCellType()) {
case STRING:
productBom = cellT.getStringCellValue();
break;
default:
throw new ServiceException("Excel格式错误:请设置成文本格式");
}
int productNameIndex = productBom.indexOf("(");
if (productNameIndex < 0) productNameIndex = productBom.indexOf("");
if (productNameIndex > 0) {
productName = productBom.substring(productNameIndex+1,productBom.length()-1);
productBom = productBom.substring(0,productNameIndex);
}
// productBom = productBom.replaceAll(".*?", "");
// productBom = productBom.replaceAll("(.*?)", "");
MesBaseMaterialInfo productMaterial = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialCode(productBom);
if (productMaterial != null) {
throw new ServiceException("Excel格式错误:物料编号:" + productBom + "的信息已存在!");
}
Long time = System.currentTimeMillis();
time = time+i;
MesBaseMaterialInfo mesProductInfo = new MesBaseMaterialInfo();
mesProductInfo.setMaterialName(productName);
mesProductInfo.setMaterialCode(productBom);
mesProductInfo.setMaterialSpec(productName+"spec");
mesProductInfo.setErpId(time);
mesProductInfo.setMaterialClassfication("1");
mesProductInfo.setActiveFlag("1");
mesBaseMaterialInfoMapper.insertMesBaseMaterialInfo(mesProductInfo);
time = time+i;
MesSaleOrder mesSaleOrder = new MesSaleOrder();
mesSaleOrder.setErpId(time);
mesSaleOrder.setSaleorderCode(Seq.getId(Seq.mesPurchaseApplyProcessSeqType, Seq.mesPurchaseApplyProcessCode));
mesSaleOrder.setMaterialCode(productBom);
mesSaleOrder.setMaterialId(mesProductInfo.getErpId());
mesSaleOrder.setOrderAmount(BigDecimal.ONE);
mesSaleOrder.setIsRelease("1");
mesSaleOrder.setSaleOrderClassfication("1");
mesSaleOrder.setIsFlag("1");
mesSaleOrderMapper.insertMesSaleOrder(mesSaleOrder);
i = i + 2;//标题下一行
while (true) {
if (i > lastRowNum) {
break;
}
Row rowC = sheet.getRow(i);
if (rowC == null) break;
Cell numberCell = rowC.getCell(0);
if (StringUtils.isNull(numberCell)) {
break;
} else {
if (numberCell.getCellType() != NUMERIC && numberCell.getCellType() != STRING) {
break;
}
}
Cell materialCodeCell = rowC.getCell(1);
String materialCode = null;
if (materialCodeCell.getCellType() == NUMERIC) {
double numericCellValue = materialCodeCell.getNumericCellValue();
materialCode = new BigDecimal(numericCellValue).toString();
} else if (materialCodeCell.getCellType() == STRING) {
materialCode = materialCodeCell.getStringCellValue();
}
Cell materialNameCell = rowC.getCell(2);
String materialName = materialNameCell.getStringCellValue();
Cell amountCell = rowC.getCell(5);
BigDecimal amount=BigDecimal.ONE;
if (amountCell.getCellType() == NUMERIC) {
double numericCellValue = amountCell.getNumericCellValue();
amount = new BigDecimal(numericCellValue);
} else if (amountCell.getCellType() == STRING) {
amount = new BigDecimal(amountCell.getStringCellValue());
}
Cell brandCell = rowC.getCell(6);
if (StringUtils.isNotEmpty(materialCode) && !materialCode.equals("物料编码")) {
MesBaseMaterialInfo materialInfo = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialCode(materialCode);
if(materialInfo!=null){
throw new ServiceException("物料编号:"+materialCode+"已经存在");
}
materialInfo = new MesBaseMaterialInfo();
materialInfo.setMaterialName(materialName);
materialInfo.setMaterialCode(materialCode);
materialInfo.setMaterialSpec(materialName+"spec");
materialInfo.setErpId(time+i);
materialInfo.setMaterialClassfication("1");
materialInfo.setActiveFlag("1");
mesBaseMaterialInfoMapper.insertMesBaseMaterialInfo(materialInfo);
MesPurchaseOrder mesPurchaseOrder = new MesPurchaseOrder();
mesPurchaseOrder.setErpId(time+i);
mesPurchaseOrder.setPoNo(Seq.getId(Seq.mesVirtualSaleOrderSeqType, Seq.mesVirtualSaleOrderCode));
mesPurchaseOrder.setMaterialId(materialInfo.getErpId());
mesPurchaseOrder.setMaterialCode(materialInfo.getMaterialCode());
mesPurchaseOrder.setPurchaseOrderClassfication("1");
mesPurchaseOrder.setOrderAmount(amount);
mesPurchaseOrder.setOrderStatus("1");
mesPurchaseOrder.setIsFlag("1");
mesPurchaseOrderMapper.insertMesPurchaseOrder(mesPurchaseOrder);
}
i++;
}
if (failureMsg.length() != 0) {
throw new ServiceException(failureMsg.toString());
}
}
} catch (IOException e) {
throw new ServiceException("文件处理错误:" + e);
} finally {
IOUtils.closeQuietly(is);
}
return "导入成功";
}
}

@ -0,0 +1,107 @@
package com.hw.mes.service.impl;
import java.util.List;
import com.hw.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesProduceStatisticsDetailMapper;
import com.hw.mes.domain.MesProduceStatisticsDetail;
import com.hw.mes.service.IMesProduceStatisticsDetailService;
/**
* Service
*
* @author xins
* @date 2024-11-26
*/
@Service
public class MesProduceStatisticsDetailServiceImpl implements IMesProduceStatisticsDetailService
{
@Autowired
private MesProduceStatisticsDetailMapper mesProduceStatisticsDetailMapper;
/**
*
*
* @param statisticsDetailId
* @return
*/
@Override
public MesProduceStatisticsDetail selectMesProduceStatisticsDetailByStatisticsDetailId(Long statisticsDetailId)
{
return mesProduceStatisticsDetailMapper.selectMesProduceStatisticsDetailByStatisticsDetailId(statisticsDetailId);
}
/**
*
*
* @param mesProduceStatisticsDetail
* @return
*/
@Override
public List<MesProduceStatisticsDetail> selectMesProduceStatisticsDetailList(MesProduceStatisticsDetail mesProduceStatisticsDetail)
{
return mesProduceStatisticsDetailMapper.selectMesProduceStatisticsDetailList(mesProduceStatisticsDetail);
}
/**
* ,join material,process
*
* @param mesProduceStatisticsDetail
* @return
*/
@Override
public List<MesProduceStatisticsDetail> selectMesProduceStatisticsDetailJoinList(MesProduceStatisticsDetail mesProduceStatisticsDetail)
{
return mesProduceStatisticsDetailMapper.selectMesProduceStatisticsDetailJoinList(mesProduceStatisticsDetail);
}
/**
*
*
* @param mesProduceStatisticsDetail
* @return
*/
@Override
public int insertMesProduceStatisticsDetail(MesProduceStatisticsDetail mesProduceStatisticsDetail)
{
mesProduceStatisticsDetail.setCreateTime(DateUtils.getNowDate());
return mesProduceStatisticsDetailMapper.insertMesProduceStatisticsDetail(mesProduceStatisticsDetail);
}
/**
*
*
* @param mesProduceStatisticsDetail
* @return
*/
@Override
public int updateMesProduceStatisticsDetail(MesProduceStatisticsDetail mesProduceStatisticsDetail)
{
return mesProduceStatisticsDetailMapper.updateMesProduceStatisticsDetail(mesProduceStatisticsDetail);
}
/**
*
*
* @param statisticsDetailIds
* @return
*/
@Override
public int deleteMesProduceStatisticsDetailByStatisticsDetailIds(Long[] statisticsDetailIds)
{
return mesProduceStatisticsDetailMapper.deleteMesProduceStatisticsDetailByStatisticsDetailIds(statisticsDetailIds);
}
/**
*
*
* @param statisticsDetailId
* @return
*/
@Override
public int deleteMesProduceStatisticsDetailByStatisticsDetailId(Long statisticsDetailId)
{
return mesProduceStatisticsDetailMapper.deleteMesProduceStatisticsDetailByStatisticsDetailId(statisticsDetailId);
}
}

@ -4,7 +4,10 @@ import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson2.JSONObject;
import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.common.core.constant.SystemConstants;
import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils;
@ -17,6 +20,8 @@ import com.hw.mes.mapper.MesMaterialBomMapper;
import com.hw.mes.mapper.MesProductPlanMapper;
import com.hw.mes.mapper.MesSaleOrderMapper;
import com.hw.mes.service.IMesMaterialBomService;
import com.hw.system.api.RemoteSysCommonService;
import com.hw.system.api.domain.common.SysPointRouter;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -24,6 +29,8 @@ import com.hw.mes.mapper.MesProductOrderMapper;
import com.hw.mes.domain.MesProductOrder;
import com.hw.mes.service.IMesProductOrderService;
import javax.annotation.Resource;
import static com.hw.common.core.utils.DateUtils.YYYY_MM_DD_HH_MM_SS;
/**
@ -49,6 +56,9 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
@Autowired
private MesSaleOrderMapper mesSaleOrderMapper;
@Resource
private RemoteSysCommonService remoteSysCommonService;
/**
*
*
@ -631,4 +641,46 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
}
}
/**
*
*/
@Override
public void productOrderOverTimeAlarm(){
// 工单状态0-待发布1-已发布2-已完成3-已开始4-暂停8-已撤回9-已删除
MesProductOrder queryProductOrder = new MesProductOrder();
queryProductOrder.setOrderStatusStr(MesConstants.UN_PUBLISH+","+MesConstants.PUBLISHED+","+MesConstants.BEGIN+","+MesConstants.PAUSE);
List<MesProductOrder> mesProductOrderList = mesProductOrderMapper.selectMesProductOrderList(queryProductOrder);
Date currentDate = new Date();
List<MesProductOrder> overTimeProductOrderList = mesProductOrderList.stream()
.filter(mpo -> mpo.getPlanEndTime()!=null && mpo.getPlanEndTime().getTime() <= currentDate.getTime()).collect(Collectors.toList());
if(overTimeProductOrderList!=null && !overTimeProductOrderList.isEmpty()){
// String nickName = SecurityUtils.getLoginUser().getNickname();
// for(MesProductOrder mesProductOrder:overTimeProductOrderList){
List<SysPointRouter> sysPointRouterList = new ArrayList<>();
SysPointRouter sysPointRouter = getSysPointRouter(null, "auto", currentDate);
sysPointRouterList.add(sysPointRouter);
remoteSysCommonService.insertSysPointRouterPort(sysPointRouterList, SecurityConstants.INNER);
// }
}
}
private static SysPointRouter getSysPointRouter(Long productOrderId, String nickName, Date currentDate) {
SysPointRouter sysPointRouter = new SysPointRouter();
sysPointRouter.setModuleCode("MES");
sysPointRouter.setPointType(SystemConstants.SYS_ROUTER_POINT_TYPE_ALARM);
sysPointRouter.setRouterAddress("/mes/plan/productOrder");
if(productOrderId!=null){
JSONObject routerAddressDetailJson = new JSONObject();
routerAddressDetailJson.put("productOrderId", productOrderId);
sysPointRouter.setRouterAddressDetail(routerAddressDetailJson.toString());
}
sysPointRouter.setRemark("生产工单超时报警");
sysPointRouter.setCreateBy(nickName);
sysPointRouter.setCreateTime(currentDate);
return sysPointRouter;
}
}

@ -835,9 +835,6 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
for (MesProductPlanDetail mesProductPlanDetail : mesProductPlanDetailList) {
MesProductPlan mesProductPlan = mesProductPlanMapper.selectOnlyMesProductPlanByPlanId(mesProductPlanDetail.getPlanId());
//易耗品标识,分摊到各个生产计划明细中
//计算工时
Date realBeginTime = mesProductPlanDetail.getRealBeginTime();
Date realEndTime = mesProductPlanDetail.getRealEndTime();
@ -880,6 +877,8 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
MesProduceStatisticsDetail mesProduceStatisticsDetail = new MesProduceStatisticsDetail();
mesProduceStatisticsDetail.setProductOrderId(mesProductPlan.getProductOrderId());
mesProduceStatisticsDetail.setDispatchType(mesProductPlan.getDispatchType());
mesProduceStatisticsDetail.setDispatchId(mesProductPlan.getDispatchId());
mesProduceStatisticsDetail.setSaleOrderId(mesProductPlan.getSaleOrderId());
mesProduceStatisticsDetail.setSaleorderCode(mesProductPlan.getSaleorderCode());
mesProduceStatisticsDetail.setPlanId(mesProductPlanDetail.getPlanId());

@ -764,6 +764,19 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
}
/**
* Join user,material,process,productorder
*
* @param mesProductPlan
* @return
*/
@Override
public List<MesProductPlan> selectMesProductPlanJoinUserList(MesProductPlan mesProductPlan) {
return mesProductPlanMapper.selectMesProductPlanJoinUserList(mesProductPlan);
}
// public String executeAssignTaskResultTask() {
// ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
// boolean running = true;

@ -182,25 +182,25 @@ public class MesPurchaseApplyProcessServiceImpl implements IMesPurchaseApplyProc
* @param processActivityId
*/
private void processActivityEmailNotice(MesPurchaseApplyProcess mesPurchaseApplyProcess, MesPurchaseApplyProcessDetail processDetail, Long processActivityId) {
R<WfProcessActivity> activityRes = remoteSysCommonService.selectProcessActivityUserInfo(SecurityConstants.INNER, processActivityId);
String title = activityRes.getData().getProcessActivityName() + "[" + mesPurchaseApplyProcess.getTaskCode() + "]";
String text = mesPurchaseApplyProcess.getRemark();
List<WfProcessActivityAuth> activityAuthList = activityRes.getData().getWfProcessActivityAuthList();
List<String> userNameList = new ArrayList<>();//已通知用户
for (WfProcessActivityAuth activityAuth : activityAuthList) {
//邮件通知
String email = activityAuth.getEmail();
if (StringUtils.isNotEmpty(email)){
MailUtils.processSendEmail(email, title, text);
userNameList.add(activityAuth.getUserName());
}
}
if (userNameList.size() > 0){
processDetail.setNoticeFlag(WfConstants.PA_NOTICE_FLAG_YES);
processDetail.setNoticeAuth(String.join(",", userNameList));
} else {
processDetail.setNoticeFlag(WfConstants.PA_NOTICE_FLAG_NO);
}
// R<WfProcessActivity> activityRes = remoteSysCommonService.selectProcessActivityUserInfo(SecurityConstants.INNER, processActivityId);
// String title = activityRes.getData().getProcessActivityName() + "[" + mesPurchaseApplyProcess.getTaskCode() + "]";
// String text = mesPurchaseApplyProcess.getRemark();
// List<WfProcessActivityAuth> activityAuthList = activityRes.getData().getWfProcessActivityAuthList();
// List<String> userNameList = new ArrayList<>();//已通知用户
// for (WfProcessActivityAuth activityAuth : activityAuthList) {
// //邮件通知
// String email = activityAuth.getEmail();
// if (StringUtils.isNotEmpty(email)){
// MailUtils.processSendEmail(email, title, text);
// userNameList.add(activityAuth.getUserName());
// }
// }
// if (userNameList.size() > 0){
// processDetail.setNoticeFlag(WfConstants.PA_NOTICE_FLAG_YES);
// processDetail.setNoticeAuth(String.join(",", userNameList));
// } else {
// processDetail.setNoticeFlag(WfConstants.PA_NOTICE_FLAG_NO);
// }
}
/**

@ -6,9 +6,11 @@ import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.alibaba.fastjson2.JSONObject;
import com.hw.common.core.constant.Constants;
import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.common.core.constant.SystemConstants;
import com.hw.common.core.domain.R;
import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils;
@ -17,8 +19,11 @@ import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseMaterialInfo;
import com.hw.mes.api.domain.MesOrderBind;
import com.hw.mes.api.domain.MesSaleOrderRelate;
import com.hw.mes.domain.MesProductOrder;
import com.hw.mes.domain.MesSaleOrder;
import com.hw.mes.mapper.*;
import com.hw.system.api.RemoteSysCommonService;
import com.hw.system.api.domain.common.SysPointRouter;
import com.hw.wms.api.RemoteWmsService;
import com.hw.wms.api.domain.vo.WmsAutoOutstockVo;
import org.springframework.beans.factory.annotation.Autowired;
@ -55,6 +60,10 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
@Resource
private RemoteWmsService remoteWmsService;
@Resource
private RemoteSysCommonService remoteSysCommonService;
/**
*
*
@ -611,4 +620,51 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
mesPurchaseOrder.setBindFlag("1");
return mesPurchaseOrderMapper.selectMesPurchaseOrderJoinList(mesPurchaseOrder);
}
/**
*
*/
@Override
public void purchaseOrderOverTimeAlarm(){
// 订单状态(1待采购2采购中3采购完成4自动出库完成)
MesPurchaseOrder queryPurchaseOrder = new MesPurchaseOrder();
queryPurchaseOrder.setPurchaseOrderClassfication(MesConstants.MES_PURCHASE_ORDER_CLASSFICATION_ERP);
queryPurchaseOrder.setOrderStatusStr(MesConstants.MES_PURCHASE_ORDER_STATUS_TOPURCHASE+","+MesConstants.MES_PURCHASE_ORDER_STATUS_PURCHASEING);
List<MesPurchaseOrder> purchaseOrderList = mesPurchaseOrderMapper.selectMesPurchaseOrderList(queryPurchaseOrder);
Date currentDate = new Date();
List<MesPurchaseOrder> overTimePurchaseOrderList = purchaseOrderList.stream()
.filter(mpo -> mpo.getPlanDeliveryDate()!=null && mpo.getPlanDeliveryDate().getTime() <= currentDate.getTime()).collect(Collectors.toList());
if(overTimePurchaseOrderList!=null && !overTimePurchaseOrderList.isEmpty()){
// String nickName = SecurityUtils.getLoginUser().getNickname();
// for(MesProductOrder mesProductOrder:overTimeProductOrderList){
List<SysPointRouter> sysPointRouterList = new ArrayList<>();
SysPointRouter sysPointRouter = getSysPointRouter(null, currentDate);
sysPointRouterList.add(sysPointRouter);
remoteSysCommonService.insertSysPointRouterPort(sysPointRouterList, SecurityConstants.INNER);
// }
}
}
private static SysPointRouter getSysPointRouter(Long purchaseOrderId, Date currentDate) {
SysPointRouter sysPointRouter = new SysPointRouter();
sysPointRouter.setModuleCode("MES");
sysPointRouter.setPointType(SystemConstants.SYS_ROUTER_POINT_TYPE_ALARM);
sysPointRouter.setRouterAddress("/mes/plan/purchaseOrder");
if(purchaseOrderId!=null){
JSONObject routerAddressDetailJson = new JSONObject();
routerAddressDetailJson.put("purchaseOrderId", purchaseOrderId);
sysPointRouter.setRouterAddressDetail(routerAddressDetailJson.toString());
}
sysPointRouter.setRemark("采购订单交货超时报警");
sysPointRouter.setCreateBy("auto");
sysPointRouter.setCreateTime(currentDate);
return sysPointRouter;
}
}

@ -4,25 +4,35 @@ import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.alibaba.fastjson2.JSONObject;
import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.common.core.constant.SystemConstants;
import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseMaterialInfo;
import com.hw.mes.api.domain.MesPurchaseOrder;
import com.hw.mes.api.domain.MesSaleOrderRelate;
import com.hw.mes.api.domain.vo.MesBaseBarcodeInfoTransferVo;
import com.hw.mes.api.domain.vo.MesSaleOrderTransferVo;
import com.hw.mes.domain.MesMaterialBom;
import com.hw.mes.domain.MesSaleOrderMaterial;
import com.hw.mes.mapper.*;
import com.hw.system.api.RemoteSysCommonService;
import com.hw.system.api.domain.common.SysPointRouter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.mes.domain.MesSaleOrder;
import com.hw.mes.service.IMesSaleOrderService;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/**
* Service
*
@ -49,6 +59,9 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService {
@Autowired
private MesSaleOrderMaterialMapper mesSaleOrderMaterialMapper;
@Resource
private RemoteSysCommonService remoteSysCommonService;
/**
*
*
@ -292,9 +305,9 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService {
for (MesSaleOrderMaterial mesSaleOrderMaterial : mesSaleOrderMaterialList) {
if (mesSaleOrderMaterial.getUsedAmount() != null && mesSaleOrderMaterial.getUsedAmount().compareTo(BigDecimal.ZERO) > 0) {
BigDecimal realOutstockAmount = mesSaleOrderMaterial.getRealOutstockAmount();
BigDecimal totalUsedAmount = mesSaleOrderMaterial.getTotalUsedAmount()==null?BigDecimal.ZERO:mesSaleOrderMaterial.getTotalUsedAmount();//其他订单已分摊数量
BigDecimal oriUsedAmount = mesSaleOrderMaterial.getOriUsedAmount()==null?BigDecimal.ZERO:mesSaleOrderMaterial.getOriUsedAmount();
BigDecimal usedAmount = mesSaleOrderMaterial.getUsedAmount()==null?BigDecimal.ZERO:mesSaleOrderMaterial.getUsedAmount();
BigDecimal totalUsedAmount = mesSaleOrderMaterial.getTotalUsedAmount() == null ? BigDecimal.ZERO : mesSaleOrderMaterial.getTotalUsedAmount();//其他订单已分摊数量
BigDecimal oriUsedAmount = mesSaleOrderMaterial.getOriUsedAmount() == null ? BigDecimal.ZERO : mesSaleOrderMaterial.getOriUsedAmount();
BigDecimal usedAmount = mesSaleOrderMaterial.getUsedAmount() == null ? BigDecimal.ZERO : mesSaleOrderMaterial.getUsedAmount();
BigDecimal updateAmount = usedAmount.subtract(oriUsedAmount);//修改的数量差
if (updateAmount.compareTo(BigDecimal.ZERO) != 0) {
BigDecimal newTotalUsedAmount = totalUsedAmount.add(usedAmount);
@ -306,8 +319,8 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService {
if (mesSaleOrderMaterial.getSaleOrderMaterialId() != null) {
// toUpdatedMesSaleOrderMateriaList.add(mesSaleOrderMaterial);
mesSaleOrderMaterial.setUpdateBy(nickName);
mesSaleOrderMaterial.setUpdateTime(currentDate);
mesSaleOrderMaterial.setUpdateBy(nickName);
mesSaleOrderMaterial.setUpdateTime(currentDate);
mesSaleOrderMaterialMapper.updateMesSaleOrderMaterial(mesSaleOrderMaterial);
} else {
@ -326,4 +339,49 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService {
return 1;
}
/**
*
*/
@Override
public void saleOrderOverTimeAlarm() {
// 状态0-待发布工单1-已发布工单2-已开始3-已完成)
MesSaleOrder querySaleOrder = new MesSaleOrder();
querySaleOrder.setSaleOrderClassfication(MesConstants.MES_SALE_ORDER_CLASSFICATION_ERP);
querySaleOrder.setIsReleaseStr(MesConstants.MES_SALE_ORDER_IS_RELEASE_TO_PUBLISH + "," +
MesConstants.MES_SALE_ORDER_IS_RELEASE_PUBLISHED + "," + MesConstants.MES_SALE_ORDER_IS_RELEASE_BEGIN);
List<MesSaleOrder> mesSaleOrderList = mesSaleOrderMapper.selectMesSaleOrderList(querySaleOrder);
Date currentDate = new Date();
List<MesSaleOrder> overTimeSaleOrderList = mesSaleOrderList.stream()
.filter(mpo -> mpo.getPlanDeliveryDate() != null && mpo.getPlanDeliveryDate().getTime() <= currentDate.getTime()).collect(Collectors.toList());
if (overTimeSaleOrderList != null && !overTimeSaleOrderList.isEmpty()) {
// String nickName = SecurityUtils.getLoginUser().getNickname();
// for(MesProductOrder mesProductOrder:overTimeProductOrderList){
List<SysPointRouter> sysPointRouterList = new ArrayList<>();
SysPointRouter sysPointRouter = getSysPointRouter(null, currentDate);
sysPointRouterList.add(sysPointRouter);
remoteSysCommonService.insertSysPointRouterPort(sysPointRouterList, SecurityConstants.INNER);
// }
}
}
private static SysPointRouter getSysPointRouter(Long saleOrderId, Date currentDate) {
SysPointRouter sysPointRouter = new SysPointRouter();
sysPointRouter.setModuleCode("MES");
sysPointRouter.setPointType(SystemConstants.SYS_ROUTER_POINT_TYPE_ALARM);
sysPointRouter.setRouterAddress("/mes/plan/saleOrder");
if (saleOrderId != null) {
JSONObject routerAddressDetailJson = new JSONObject();
routerAddressDetailJson.put("saleOrderId", saleOrderId);
sysPointRouter.setRouterAddressDetail(routerAddressDetailJson.toString());
}
sysPointRouter.setRemark("销售订单交货超时报警");
sysPointRouter.setCreateBy("auto");
sysPointRouter.setCreateTime(currentDate);
return sysPointRouter;
}
}

@ -71,7 +71,7 @@
<if test="projectId != null ">and project_id = #{projectId}</if>
<if test="activeFlag != null and activeFlag != ''">and active_flag = #{activeFlag}</if>
</where>
order by material_id, create_time desc
order by material_bom_id desc
</select>
<select id="selectMesMaterialBomByMaterialBomId" parameterType="Long" resultMap="MesMaterialBomResult">

@ -7,6 +7,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="MesProduceStatisticsDetail" id="MesProduceStatisticsDetailResult">
<result property="statisticsDetailId" column="statistics_detail_id" />
<result property="productOrderId" column="product_order_id" />
<result property="dispatchType" column="dispatch_type" />
<result property="dispatchId" column="dispatch_id" />
<result property="saleOrderId" column="sale_order_id" />
<result property="saleorderCode" column="saleorder_code" />
<result property="planId" column="plan_id" />
@ -44,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectMesProduceStatisticsDetailVo">
select statistics_detail_id, product_order_id, sale_order_id, saleorder_code, plan_id, plan_code, plan_detail_id, plan_detail_code, product_id, product_code, product_name, product_spec, user_id, nick_name, process_id, process_name, plan_begin_time, plan_end_time, real_begin_time, real_end_time, produce_time, create_time from mes_produce_statistics_detail
select statistics_detail_id, product_order_id, dispatch_type,dispatch_id,sale_order_id, saleorder_code, plan_id, plan_code, plan_detail_id, plan_detail_code, product_id, product_code, product_name, product_spec, user_id, nick_name, process_id, process_name, plan_begin_time, plan_end_time, real_begin_time, real_end_time, produce_time, create_time from mes_produce_statistics_detail
</sql>
<select id="selectMesProduceStatisticsDetailList" parameterType="MesProduceStatisticsDetail" resultMap="MesProduceStatisticsDetailResult">
@ -85,6 +87,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into mes_produce_statistics_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="productOrderId != null">product_order_id,</if>
<if test="dispatchType != null">dispatch_type,</if>
<if test="dispatchId != null">dispatch_id,</if>
<if test="saleOrderId != null">sale_order_id,</if>
<if test="saleorderCode != null">saleorder_code,</if>
<if test="planId != null">plan_id,</if>
@ -108,6 +112,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productOrderId != null">#{productOrderId},</if>
<if test="dispatchType != null">#{dispatchType},</if>
<if test="dispatchId != null">#{dispatchId},</if>
<if test="saleOrderId != null">#{saleOrderId},</if>
<if test="saleorderCode != null">#{saleorderCode},</if>
<if test="planId != null">#{planId},</if>
@ -187,4 +193,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
( #{item.statisticsDetailMaterialId}, #{item.statisticsDetailId}, #{item.materialId}, #{item.materialCode}, #{item.materialName}, #{item.materialSpec}, #{item.usedAmount})
</foreach>
</insert>
<sql id="selectMesProduceStatisticsDetailJoinVo">
select mpsd.statistics_detail_id, mpsd.product_order_id, mpsd.dispatch_type,mpsd.dispatch_id,mpsd.sale_order_id, mpsd.saleorder_code, mpsd.plan_id,
mpsd.plan_code, mpsd.plan_detail_id, mpsd.plan_detail_code, mpsd.product_id,
mpsd.user_id, mpsd.nick_name, mpsd.process_id, mpsd.plan_begin_time, mpsd.plan_end_time, mpsd.real_begin_time,
mpsd.real_end_time, mpsd.produce_time, mpsd.create_time,
mbmi.material_code as product_code,mbmi.material_name as product_name,mbmi.material_spec as product_spec,mbpi.process_name
from mes_produce_statistics_detail mpsd
left join mes_base_material_info mbmi on mpsd.product_id = mbmi.material_id
left join mes_base_process_info mbpi on mpsd.process_id=mbpi.process_id
</sql>
<select id="selectMesProduceStatisticsDetailJoinList" parameterType="MesProduceStatisticsDetail" resultMap="MesProduceStatisticsDetailResult">
<include refid="selectMesProduceStatisticsDetailJoinVo"/>
<where>
<if test="productOrderId != null "> and mpsd.product_order_id = #{productOrderId}</if>
<if test="saleOrderId != null "> and mpsd.sale_order_id = #{saleOrderId}</if>
<if test="saleorderCode != null and saleorderCode != ''"> and mpsd.saleorder_code like concat('%', #{saleorderCode},'%')</if>
<if test="planId != null "> and mpsd.plan_id = #{planId}</if>
<if test="planCode != null and planCode != ''"> and mpsd.plan_code like concat('%', #{planCode},'%')</if>
<if test="planDetailCode != null and planDetailCode != ''"> and mpsd.plan_detail_code like concat('%', #{planDetailCode},'%')</if>
<if test="productId != null "> and mpsd.product_id = #{productId}</if>
<if test="productCode != null and productCode != ''"> and mbmi.material_code like concat('%', #{productCode},'%')</if>
<if test="productName != null and productName != ''"> and mbmi.material_name like concat('%', #{productName}, '%')</if>
<if test="productSpec != null and productSpec != ''"> and mbmi.material_spec like concat('%', #{productSpec},'%')</if>
<if test="userId != null "> and mpsd.user_id = #{userId}</if>
<if test="nickName != null and nickName != ''"> and mpsd.nick_name like concat('%', #{nickName}, '%')</if>
<if test="processId != null "> and mpsd.process_id = #{processId}</if>
<if test="processName != null and processName != ''"> and mpsd.process_name like concat('%', #{processName}, '%')</if>
<if test="planBeginTime != null "> and mpsd.plan_begin_time = #{planBeginTime}</if>
<if test="planEndTime != null "> and mpsd.plan_end_time = #{planEndTime}</if>
<if test="realBeginTime != null "> and mpsd.real_begin_time = #{realBeginTime}</if>
<if test="realEndTime != null "> and mpsd.real_end_time = #{realEndTime}</if>
<if test="produceTime != null "> and mpsd.produce_time = #{produceTime}</if>
</where>
</select>
</mapper>

@ -382,6 +382,9 @@
<if test="params.planBeginTime != null and params.planEndTime != null">
AND (plan_begin_time &lt;= #{params.planEndTime} AND plan_end_time &gt;= #{params.planBeginTime})
</if>
<if test='overtimeFlag != null and overtimeFlag != "" and overtimeFlag == "1"'>and mpo.order_status in ('0','1','3','4') and mpo.plan_end_time is not null and mpo.plan_end_time &lt; now() </if>
<if test='overtimeFlag != null and overtimeFlag != "" and overtimeFlag == "0"'>and mpo.plan_end_time is not null and mpo.plan_end_time >= now() </if>
</where>
order by mpo.product_order_id desc
</select>

@ -56,6 +56,8 @@
<result property="nickName" column="nick_name"/>
<result property="cabinetChannel" column="cabinet_channel"/>
<result property="productId" column="product_id"/>
<result property="dispatchType" column="dispatch_type"/>
<result property="dispatchId" column="dispatch_id"/>
</resultMap>
<resultMap id="MesProductPlanMesProductPlanDetailResult" type="MesProductPlan" extends="MesProductPlanResult">
@ -580,9 +582,89 @@
a.update_by,
a.update_time,
b.sale_order_id,
b.saleorder_code
b.saleorder_code,
b.dispatch_type,
b.dispatch_id
from mes_product_plan a left join mes_product_order b on a.product_order_id = b.product_order_id
where a.plan_id = #{planId}
</select>
<sql id="selectMesProductPlanJoinUserVo">
select mpp.plan_id,
mpp.product_order_id,
po.order_code,
mpp.plan_code,
mpp.dispatch_code,
mpp.material_id,
mi.material_code,
mi.material_name,
mi.material_spec,
mpp.material_bom_id,
mpp.process_id,
bpi.process_name,
mpp.process_order,
mpp.last_process_id,
mpp.station_id,
mpp.user_id,
mpp.production_time,
mpp.dispatch_amount,
mpp.plan_amount,
mpp.complete_amount,
mpp.plan_begin_time,
mpp.plan_end_time,
mpp.real_begin_time,
mpp.real_end_time,
mpp.attach_id,
mpp.sop_id,
po.sale_order_id,
po.saleorder_code,
mpp.plan_status,
mpp.final_process_flag,
mpp.is_flag,
mpp.remark,
mpp.create_by,
mpp.create_time,
mpp.update_by,
mpp.update_time,
su.nick_name as user_name
from mes_product_plan mpp
left join mes_base_process_info bpi on bpi.process_id = mpp.process_id
left join mes_base_material_info mi on mi.material_id = mpp.material_id
left join mes_product_order po on po.product_order_id = mpp.product_order_id
left join sys_user su on mpp.user_id=su.user_id
</sql>
<select id="selectMesProductPlanJoinUserList" parameterType="MesProductPlan" resultMap="MesProductPlanResult">
<include refid="selectMesProductPlanJoinUserVo"/>
<where>
<if test="productOrderId != null ">and mpp.product_order_id = #{productOrderId}</if>
<if test="planCode != null and planCode != ''">and mpp.plan_code like concat('%', #{planCode},'%')</if>
<if test="dispatchCode != null and dispatchCode != ''">and mpp.dispatch_code = #{dispatchCode}</if>
<if test="orderCode != null and orderCode != ''">and po.order_code like concat('%', #{orderCode},'%')</if>
<if test="materialId != null ">and mpp.material_id = #{materialId}</if>
<if test="materialBomId != null ">and mpp.material_bom_id = #{materialBomId}</if>
<if test="processId != null ">and mpp.process_id = #{processId}</if>
<if test="processOrder != null ">and mpp.process_order = #{processOrder}</if>
<if test="lastProcessId != null ">and mpp.last_process_id = #{lastProcessId}</if>
<if test="userId != null ">and su.user_id = #{userId}</if>
<if test="stationId != null ">and mpp.station_id = #{stationId}</if>
<if test="userId != null ">and mpp.user_id = #{userId}</if>
<if test="productionTime != null ">and mpp.production_time = #{productionTime}</if>
<if test="planAmount != null ">and mpp.plan_amount = #{planAmount}</if>
<if test="completeAmount != null ">and mpp.complete_amount = #{completeAmount}</if>
<if test="planBeginTime != null ">and mpp.plan_begin_time = #{planBeginTime}</if>
<if test="planEndTime != null ">and mpp.plan_end_time = #{planEndTime}</if>
<if test="realBeginTime != null ">and mpp.real_begin_time = #{realBeginTime}</if>
<if test="realEndTime != null ">and mpp.real_end_time = #{realEndTime}</if>
<if test="attachId != null and attachId != ''">and mpp.attach_id = #{attachId}</if>
<if test="planStatus != null and planStatus != ''">and mpp.plan_status = #{planStatus}</if>
<if test="isFlag != null and isFlag != ''">and mpp.is_flag = #{isFlag}</if>
</where>
</select>
</mapper>

@ -126,6 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="srcBillNo != null and srcBillNo != ''"> and src_bill_no like concat('%', #{srcBillNo}, '%')</if>
<if test="tondBase != null and tondBase != ''"> and tond_base like concat('%', #{tondBase}, '%')</if>
<if test="orderStatusStr != null and orderStatusStr != ''"> and order_status in (${orderStatusStr})</if>
</where>
</select>

@ -7,6 +7,8 @@ import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.hw.common.core.constant.WmsConstants;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
@ -350,4 +352,12 @@ public class SysUserController extends BaseController
{
return success(deptService.selectDeptTreeList(dept));
}
@GetMapping("/getUserList")
public AjaxResult getUserList(SysUser sysUser) {
List<SysUser> list = userService.selectUserList(sysUser);
return success(list);
}
}

@ -70,7 +70,7 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
* @return
*/
@Override
@Transactional
// @Transactional
public int synchronizeInventoryInformationToERP() {
WmsRawInstock wmsRawInstock = new WmsRawInstock();
int result = 0;
@ -123,7 +123,7 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
log.info("synchronizeInventoryInformationToERP同步原材料入库成功:" + paramsResult.toString());
} else {
log.error("synchronizeInventoryInformationToERP同步原材料入库失败:" + paramsResult.toString());
throw new RuntimeException("同步原材料入库失败" + paramsResult.toString());
throw new ServiceException("同步原材料入库失败" + paramsResult.toString());
}
}
@ -133,17 +133,16 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
* @return
*/
@Override
@Transactional
public int synchronizeRawMaterialDeliveryInformationToERP() {
int result = 0;
// WmsRawOutstock otherRawOutstock = new WmsRawOutstock();
// otherRawOutstock.setTaskTypeStr(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_PICKING + "," + WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_INSTALL
// + "," + WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_OTHER);
// List<WmsRawOutstock> otherRawOutstockList = wmsRawOutstockMapper.selectWmsRawOutstockERPNotSynchronized(otherRawOutstock);
// Map<Long, List<WmsRawOutstock>> otherMaterialIdMap = otherRawOutstockList.stream().collect(Collectors.groupingBy(WmsRawOutstock::getMaterialId));
// for (Long materialId : otherMaterialIdMap.keySet()) {
// result += syncOutstockInformation(otherMaterialIdMap, materialId, "");
// }
WmsRawOutstock otherRawOutstock = new WmsRawOutstock();
otherRawOutstock.setTaskTypeStr(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_PICKING + "," + WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_INSTALL
+ "," + WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_OTHER);
List<WmsRawOutstock> otherRawOutstockList = wmsRawOutstockMapper.selectWmsRawOutstockERPNotSynchronized(otherRawOutstock);
Map<Long, List<WmsRawOutstock>> otherMaterialIdMap = otherRawOutstockList.stream().collect(Collectors.groupingBy(WmsRawOutstock::getMaterialId));
for (Long materialId : otherMaterialIdMap.keySet()) {
result += syncOutstockInformation(otherMaterialIdMap, materialId, "");
}
WmsRawOutstock returnRawOutstock = new WmsRawOutstock();
returnRawOutstock.setTaskType(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK);

@ -382,7 +382,7 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
wmsProductOutstock.setPlanDetailCode(planDetailCode);
wmsProductOutstock.setSaleOrderId(saleOrderId);
wmsProductOutstock.setSaleorderCode(saleorderCode);
wmsProductOutstock.setProductBatch(materialBarcode);
wmsProductOutstock.setProductBatch(mesBaseBarcodeInfo.getBarcodeInfo());
wmsProductOutstock.setApplyBy(userName);
wmsProductOutstock.setApplyDate(currentDate);
wmsProductOutstock.setTaskCode(Seq.getId(Seq.productOutstockSeqType, Seq.productOutstockCode));
@ -448,7 +448,7 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
}
productOutstock.setUpdateDate(currentDate);
productOutstock.setUpdateBy(userName);
productOutstock.setProductBatch(materialBarcode);
productOutstock.setProductBatch(mesBaseBarcodeInfo.getBarcodeInfo());
wmsProductOutstockMapper.updateWmsProductOutstock(productOutstock);
wmsProductStockMapper.deleteWmsProductStockByProductStockId(productStock.getProductStockId());

@ -1,4 +1,4 @@
# Tomcat
# 测试92服务器
server:
port: 7304
@ -15,13 +15,13 @@ spring:
discovery:
# 服务注册地址
server-addr: 175.27.215.92:8848
namespace: jyhb-test
group: xins1
namespace: jyhb100
group: jyhb
config:
# 配置中心地址
server-addr: 175.27.215.92:8848
namespace: jyhb-test
group: xins1
namespace: jyhb100
group: jyhb
# 配置文件格式
file-extension: yml
# 共享配置
@ -29,9 +29,7 @@ spring:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
## Tomcat
## 92服务器
#server:
# port: 7304
#
@ -60,3 +58,67 @@ spring:
# # 共享配置
# shared-configs:
# - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
## 测试100正式服务器
#server:
# port: 7304
#
## Spring
#spring:
# application:
# # 应用名称
# name: hw-wms
# profiles:
# # 环境配置
# active: dev
# cloud:
# nacos:
# discovery:
# # 服务注册地址
# server-addr: 127.0.0.1:8848
# namespace: jyhb100
# group: xins
# config:
# # 配置中心地址
# server-addr: 127.0.0.1:8848
# namespace: jyhb100
# group: xins
# # 配置文件格式
# file-extension: yml
# # 共享配置
# shared-configs:
# - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
## 正式服务器
#server:
# port: 7304
#
## Spring
#spring:
# application:
# # 应用名称
# name: hw-wms
# profiles:
# # 环境配置
# active: dev
# cloud:
# nacos:
# discovery:
# # 服务注册地址
# server-addr: 172.16.12.100:8848
# namespace: jyhb
# group: jyhb
# config:
# # 配置中心地址
# server-addr: 172.16.12.100:8848
# namespace: jyhb
# group: jyhb
# # 配置文件格式
# file-extension: yml
# # 共享配置
# shared-configs:
# - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

@ -257,6 +257,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and (wpi.erp_status is null or wpi.erp_status != '1')
and wpi.instock_type = '1'
and mbmi.material_classfication = '1'
and mbmi.material_unit_id is not null and mbmi.material_unit_id !=''
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
and wpi.apply_date between #{beginTime} and #{endTime}
</if>

@ -334,6 +334,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and wpo.apply_qty >= wpo.outstock_qty
and wpo.outstock_qty > if(wpo.erp_amount is null, 0, wpo.erp_amount)
and mbmi.material_classfication = '1'
and mbmi.material_unit_id is not null and mbmi.material_unit_id !=''
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
and wpi.apply_date between #{beginTime} and #{endTime}
</if>

@ -232,6 +232,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and wri.instock_amount > if(wri.erp_amount is null, 0, wri.erp_amount)
and wri.purchase_order_id is not null and wri.purchase_order_id !=0
and mbmi.material_classfication = '1'
and mbmi.material_unit_id is not null and mbmi.material_unit_id !=''
</select>
<select id="monthRawInAmount" resultType="java.math.BigDecimal">
select sum(instock_amount) inStock from wms_raw_instock where DATE_FORMAT( apply_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' ) and warehouse_id = 311

@ -385,6 +385,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and wro.outstock_amount >= wro.real_outstock_amount
and wro.real_outstock_amount > if(wro.erp_amount is null, 0, wro.erp_amount)
and mbmi.material_classfication = '1'
and mbmi.material_unit_id is not null and mbmi.material_unit_id !=''
<if test="taskTypeStr != null and taskTypeStr != ''"> and wro.task_type in (${taskTypeStr})</if>
<if test="taskType != null and taskType != ''"> and wro.task_type = #{taskType}</if>
</where>

Loading…
Cancel
Save