Merge remote-tracking branch 'origin/master'

master
夜笙歌 7 months ago
commit 68b752d08e

@ -223,4 +223,15 @@ public interface RemoteMesService {
*/ */
@GetMapping("/purchaseOrder/selectPurchaseOrderJoinSupplierProjectByOrderId/{purchaseOrderId}") @GetMapping("/purchaseOrder/selectPurchaseOrderJoinSupplierProjectByOrderId/{purchaseOrderId}")
public R<MesPurchaseOrder> selectPurchaseOrderJoinSupplierProjectByOrderId(@PathVariable("purchaseOrderId") Long purchaseOrderId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); 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 Long materialBomId;
private String orderStatusStr;
public Long getSerialNumber() { public Long getSerialNumber() {
return serialNumber; return serialNumber;
@ -770,6 +772,14 @@ public class MesPurchaseOrder extends BaseEntity {
this.materialBomId = materialBomId; this.materialBomId = materialBomId;
} }
public String getOrderStatusStr() {
return orderStatusStr;
}
public void setOrderStatusStr(String orderStatusStr) {
this.orderStatusStr = orderStatusStr;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) 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) { public R<MesPurchaseOrder> selectPurchaseOrderJoinSupplierProjectByOrderId(Long purchaseOrderId, String source) {
return R.fail("根据采购订单ID获取采购订单信息失败:" + throwable.getMessage()); 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_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_PURCHASE_COMPLETE = "3";//采购完成
public static final String MES_PURCHASE_ORDER_STATUS_AUTO_OUTSTOCK_COMPLETE = "4";//自动出库完成 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_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 * :1ERP2
*/ */
public static final String MES_PURCHASE_ORDER_CLASSFICATION_ERP= "1"; //ERP同步采购订单
public static final String MES_PURCHASE_ORDER_CLASSFICATION_VIRTUAL= "2"; //虚拟采购订单 public static final String MES_PURCHASE_ORDER_CLASSFICATION_VIRTUAL= "2"; //虚拟采购订单
/** /**
* :1ERP2 * :1ERP2
*/ */
public static final String MES_SALE_ORDER_CLASSFICATION_ERP= "1"; //ERP同步销售订单
public static final String MES_SALE_ORDER_CLASSFICATION_VIRTUAL= "2"; //虚拟销售订单 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_NO= "0";//未处理
public static final String MES_ALARM_INFO_HANDLE_STATUS_YES= "1";//已处理 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, USE,
/**
*
*/
OVERTIME,
} }

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

@ -28,5 +28,27 @@ public class FifthMesBorderController {
public AjaxResult workOrderProgress(){ public AjaxResult workOrderProgress(){
return AjaxResult.success(fifthMesBorderService.workOrderProgress()); return AjaxResult.success(fifthMesBorderService.workOrderProgress());
} }
/**
*
*/
@GetMapping("/productionQualified")
public AjaxResult productionQualified(){
return AjaxResult.success(fifthMesBorderService.productionQualified());
}
/**
*
*/
@GetMapping("/orderTime")
public AjaxResult orderTime(){
return AjaxResult.success(fifthMesBorderService.orderTime());
}
/**
*
*/
@GetMapping("/orderEfficiency")
public AjaxResult orderEfficiency(){
return AjaxResult.success(fifthMesBorderService.orderEfficiency());
}
} }

@ -59,4 +59,13 @@ public class ThirdMesBorderController {
return AjaxResult.success(thirdMesBorderService.rawInstock()); return AjaxResult.success(thirdMesBorderService.rawInstock());
} }
/**
*
* @return
*/
@GetMapping("/getLineStatus")
public AjaxResult getLineStatus(){
return AjaxResult.success(thirdMesBorderService.getLineStatus());
}
} }

@ -1,7 +1,9 @@
package com.hw.mes.board.service; package com.hw.mes.board.service;
import com.hw.mes.domain.MesProduceStatisticsDetail;
import com.hw.mes.domain.MesProductOrder; import com.hw.mes.domain.MesProductOrder;
import com.hw.mes.domain.MesProductionQualified;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -11,4 +13,10 @@ public interface FifthMesBorderService {
MesProductOrder productProgress(); MesProductOrder productProgress();
List<MesProductOrder> workOrderProgress(); List<MesProductOrder> workOrderProgress();
List<MesProductionQualified> productionQualified();
List<MesProduceStatisticsDetail> orderTime();
List<MesProduceStatisticsDetail> orderEfficiency();
} }

@ -16,7 +16,7 @@ public interface SecondMesBorderService {
MesProductOrder selectLatestWorkOrder(); MesProductOrder selectLatestWorkOrder();
Boolean getLineStatus(); String getLineStatus();
List<Map<Date, BigDecimal>> getHourProduction(); List<Map<Date, BigDecimal>> getHourProduction();

@ -19,4 +19,6 @@ public interface ThirdMesBorderService{
List<RawAmount> productCompleteCount(); List<RawAmount> productCompleteCount();
List<RawAmount> rawInstock(); List<RawAmount> rawInstock();
String getLineStatus();
} }

@ -2,8 +2,11 @@ package com.hw.mes.board.service.impl;
import com.hw.mes.board.service.FifthMesBorderService; import com.hw.mes.board.service.FifthMesBorderService;
import com.hw.mes.domain.MesProduceStatisticsDetail;
import com.hw.mes.domain.MesProductOrder; import com.hw.mes.domain.MesProductOrder;
import com.hw.mes.domain.MesProductionQualified;
import com.hw.mes.mapper.MesProductOrderMapper; import com.hw.mes.mapper.MesProductOrderMapper;
import com.hw.mes.mapper.MesProductionQualifiedDao;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -14,6 +17,8 @@ import java.util.List;
public class FifthMesBoardServiceImpl implements FifthMesBorderService { public class FifthMesBoardServiceImpl implements FifthMesBorderService {
@Autowired @Autowired
private MesProductOrderMapper mesProductOrderMapper; private MesProductOrderMapper mesProductOrderMapper;
@Autowired
private MesProductionQualifiedDao mesProductionQualifiedDao;
@Override @Override
public MesProductOrder productProgress() { public MesProductOrder productProgress() {
@ -24,4 +29,19 @@ public class FifthMesBoardServiceImpl implements FifthMesBorderService {
public List<MesProductOrder> workOrderProgress() { public List<MesProductOrder> workOrderProgress() {
return mesProductOrderMapper.selectFifthWorkorder(); return mesProductOrderMapper.selectFifthWorkorder();
} }
@Override
public List<MesProductionQualified> productionQualified() {
return mesProductionQualifiedDao.productionQualified();
}
@Override
public List<MesProduceStatisticsDetail> orderEfficiency() {
return mesProductOrderMapper.orderEfficiency();
}
@Override
public List<MesProduceStatisticsDetail> orderTime() {
return mesProductOrderMapper.orderTime();
}
} }

@ -29,7 +29,7 @@ public class SecondMesBoardServiceImpl implements SecondMesBorderService {
} }
@Override @Override
public Boolean getLineStatus() { public String getLineStatus() {
return mesProductOrderMapper.getLineStatus(); return mesProductOrderMapper.getLineStatus();
} }

@ -46,6 +46,11 @@ public class ThirdMesBorderServiceImpl implements ThirdMesBorderService {
} }
@Override
public String getLineStatus() {
return mesProductOrderMapper.getLineThirdStatus();
}
@Override @Override
public List<RawAmount> rawInstock() { public List<RawAmount> rawInstock() {
List<RawAmount> list = mesProductOrderMapper.rawInstock(); List<RawAmount> list = mesProductOrderMapper.rawInstock();

@ -78,4 +78,22 @@ public class MesImportController extends BaseController {
return success(message); 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 java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.hw.common.core.domain.R;
import com.hw.common.core.utils.StringUtils; import com.hw.common.core.utils.StringUtils;
import com.hw.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.domain.MesSaleOrder; import com.hw.mes.domain.MesSaleOrder;
@ -217,4 +218,20 @@ public class MesProductOrderController extends BaseController {
return toAjax(mesProductOrderService.productOrderContinue(mesProductOrder)); 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); 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 * List
* *

@ -288,4 +288,22 @@ public class MesPurchaseOrderController extends BaseController
return R.ok(mesPurchaseOrder); 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); List<MesSaleOrderRelate> list = mesSaleOrderService.getRelateProductsBySaleOrderId(saleOrderId);
return R.ok(list); 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") @Excel(name = "生产工单ID")
private Long productOrderId; private Long productOrderId;
private String dispatchType;
private Long dispatchId;
/** 销售订单ID */ /** 销售订单ID */
@Excel(name = "销售订单ID") @Excel(name = "销售订单ID")
private Long saleOrderId; private Long saleOrderId;
@ -82,22 +86,22 @@ public class MesProduceStatisticsDetail extends BaseEntity
private String processName; private String processName;
/** 计划开始时间 */ /** 计划开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "计划开始时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "计划开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date planBeginTime; private Date planBeginTime;
/** 计划结束时间 */ /** 计划结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "计划结束时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "计划结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date planEndTime; private Date planEndTime;
/** 开始时间 */ /** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date realBeginTime; private Date realBeginTime;
/** 完成时间 */ /** 完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date realEndTime; private Date realEndTime;
@ -126,7 +130,24 @@ public class MesProduceStatisticsDetail extends BaseEntity
{ {
return productOrderId; 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; this.saleOrderId = saleOrderId;
} }

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

@ -202,6 +202,9 @@ public class MesProductPlan extends BaseEntity
private String materialClassfication; private String materialClassfication;
private String dispatchType;
private Long dispatchId;
public Long getSaleOrderId() { public Long getSaleOrderId() {
return saleOrderId; return saleOrderId;
@ -608,6 +611,22 @@ public class MesProductPlan extends BaseEntity
this.materialClassfication = materialClassfication; 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 @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

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

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

@ -8,6 +8,7 @@ import java.util.Map;
import com.hw.mes.board.domain.DmsRealtimeStatusHistory; import com.hw.mes.board.domain.DmsRealtimeStatusHistory;
import com.hw.mes.board.domain.RawAmount; import com.hw.mes.board.domain.RawAmount;
import com.hw.mes.board.domain.RecordIotenvInstant; import com.hw.mes.board.domain.RecordIotenvInstant;
import com.hw.mes.domain.MesProduceStatisticsDetail;
import com.hw.mes.domain.MesProductOrder; import com.hw.mes.domain.MesProductOrder;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -20,6 +21,8 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface MesProductOrderMapper public interface MesProductOrderMapper
{ {
List<MesProduceStatisticsDetail> orderEfficiency();
/** /**
* *
* *
@ -97,7 +100,7 @@ public interface MesProductOrderMapper
MesProductOrder selectLatestWorkOrder(); MesProductOrder selectLatestWorkOrder();
Boolean getLineStatus(); String getLineStatus();
List<Map<Date, BigDecimal>> getHourProduction(); List<Map<Date, BigDecimal>> getHourProduction();
@ -122,4 +125,8 @@ public interface MesProductOrderMapper
List<Map<String, Object>> productAmount(); List<Map<String, Object>> productAmount();
List<MesProductOrder> thirdOrderPlan(); List<MesProductOrder> thirdOrderPlan();
List<MesProduceStatisticsDetail> orderTime();
String getLineThirdStatus();
} }

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

@ -1,6 +1,7 @@
package com.hw.mes.mapper; package com.hw.mes.mapper;
import com.hw.mes.domain.MesProductionQualified; import com.hw.mes.domain.MesProductionQualified;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@ -12,7 +13,9 @@ import java.util.List;
* @author makejava * @author makejava
* @since 2024-11-25 11:14:21 * @since 2024-11-25 11:14:21
*/ */
@Mapper
public interface MesProductionQualifiedDao { public interface MesProductionQualifiedDao {
List<MesProductionQualified> productionQualified();
/** /**
* ID * ID

@ -1,6 +1,8 @@
package com.hw.mes.service; package com.hw.mes.service;
import com.hw.common.core.exception.ServiceException;
import com.hw.mes.domain.MesPurchaseRequisitionTemplate; import com.hw.mes.domain.MesPurchaseRequisitionTemplate;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.util.List; import java.util.List;
@ -41,4 +43,15 @@ public interface IMesImportService
*/ */
String raiseCapitalImportData(MultipartFile file, boolean updateSupport, String operName); 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 * @param mesProductOrder
*/ */
public List<MesMaterialBom> getMaterialUsages(MesProductOrder mesProductOrder); public List<MesMaterialBom> getMaterialUsages(MesProductOrder mesProductOrder);
/**
*
*/
public void productOrderOverTimeAlarm();
} }

@ -178,4 +178,13 @@ public interface IMesProductPlanService
* @return * @return
*/ */
public int deleteProductPlansByDispatchCode(MesProductPlanDeleteVo mesProductPlanDeleteVo); 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 * @return
*/ */
public List<MesPurchaseOrder> selectBindPurchaseOrders(MesPurchaseOrder mesPurchaseOrder); public List<MesPurchaseOrder> selectBindPurchaseOrders(MesPurchaseOrder mesPurchaseOrder);
/**
*
*/
public void purchaseOrderOverTimeAlarm();
} }

@ -121,4 +121,9 @@ public interface IMesSaleOrderService
* @return * @return
*/ */
public int updateMesSaleOrderMaterials(List<MesSaleOrderMaterial> mesSaleOrderMaterialList); 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.StringUtils;
import com.hw.common.core.utils.ip.IpUtils; import com.hw.common.core.utils.ip.IpUtils;
import com.hw.common.core.utils.uuid.Seq; 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.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.*; import com.hw.mes.api.domain.*;
import com.hw.mes.config.MesConfig; 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.WmsWarehouseMaterial;
import com.hw.wms.api.domain.vo.WmsProductStockVo; import com.hw.wms.api.domain.vo.WmsProductStockVo;
import com.hw.wms.api.domain.vo.WmsRawStockVo; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
@ -39,6 +42,8 @@ import java.util.stream.Collectors;
*/ */
@Service @Service
public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService { public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService {
private static final Logger log = LoggerFactory.getLogger(MesBaseBarcodeInfoServiceImpl.class);
@Autowired @Autowired
private MesBaseBarcodeInfoMapper mesBaseBarcodeInfoMapper; private MesBaseBarcodeInfoMapper mesBaseBarcodeInfoMapper;
@ -905,12 +910,14 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
//先根据之前的成品条码信息获取托盘信息 //先根据之前的成品条码信息获取托盘信息
MesBaseBarcodeInfo productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(oriProductBarcode); MesBaseBarcodeInfo productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(oriProductBarcode);
log.info("1:"+productBarcodeInfo.toString());
if (productBarcodeInfo == null) { if (productBarcodeInfo == null) {
allErrorMsgBuilder.append("成品/配对码").append(oriProductBarcode).append("不存在;"); allErrorMsgBuilder.append("成品/配对码").append(oriProductBarcode).append("不存在;");
} }
if(productBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_BIND)){ if(productBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_BIND)){
productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(productBarcodeInfo.getBindBarcode()); productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(productBarcodeInfo.getBindBarcode());
log.info("2:"+productBarcodeInfo.toString());
if (productBarcodeInfo == null) { if (productBarcodeInfo == null) {
allErrorMsgBuilder.append("成品/配对码[").append(oriProductBarcode).append("]的成品不存在;"); allErrorMsgBuilder.append("成品/配对码[").append(oriProductBarcode).append("]的成品不存在;");
} }
@ -957,19 +964,29 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
materialId = this.insertNewVirtualMaterial(barcodeInfo,mergeMaterialName, userName, currentDate); materialId = this.insertNewVirtualMaterial(barcodeInfo,mergeMaterialName, userName, currentDate);
} else { } 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) { if (basePalletInfo == null) {
allErrorMsgBuilder.append("此成品条码没有绑定托盘信息;"); allErrorMsgBuilder.append("此成品条码没有绑定托盘信息;");
} else { } else {
palletInfoCode = basePalletInfo.getPalletInfoCode(); 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); productBarcodeInfoList.add(productBarcodeInfo);
basePalletInfoList.add(basePalletInfo); 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.core.utils.ip.IpUtils;
import com.hw.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseStationInfo; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesBaseStationInfoMapper; import com.hw.mes.mapper.MesBaseStationInfoMapper;
@ -23,6 +25,8 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
@Autowired @Autowired
private MesBaseStationInfoMapper mesBaseStationInfoMapper; private MesBaseStationInfoMapper mesBaseStationInfoMapper;
private static final Logger log = LoggerFactory.getLogger(MesBaseStationInfoServiceImpl.class);
/** /**
* *
* *
@ -101,11 +105,12 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
*/ */
@Override @Override
public MesBaseStationInfo getLoginStationInfo() { public MesBaseStationInfo getLoginStationInfo() {
String ipAddress = SecurityUtils.getLoginUser().getIpaddr(); String ipAddress = IpUtils.getIpAddr();
// ipAddress = "192.168.2.25"; // ipAddress = "192.168.2.25";
log.info(ipAddress+"---"+SecurityUtils.getLoginUser().getIpaddr());
MesBaseStationInfo mesBaseStationInfo = mesBaseStationInfoMapper.selectMesBaseStationInfoByStationIp(ipAddress); MesBaseStationInfo mesBaseStationInfo = mesBaseStationInfoMapper.selectMesBaseStationInfoByStationIp(ipAddress);
Integer processFloor = SecurityUtils.getProcessFloor(); Integer processFloor = SecurityUtils.getLoginUser().getProcessFloor();
if (mesBaseStationInfo != null && mesBaseStationInfo.getFloor() != null && !mesBaseStationInfo.getFloor().equals(processFloor)) { if (mesBaseStationInfo != null && mesBaseStationInfo.getFloor() != null && !mesBaseStationInfo.getFloor().equals(processFloor)) {
throw new ServiceException("请在" + 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.jindie.api.RemoteJindieService;
import com.hw.mes.api.RemoteMesService; import com.hw.mes.api.RemoteMesService;
import com.hw.mes.api.domain.MesBaseMaterialInfo; import com.hw.mes.api.domain.MesBaseMaterialInfo;
import com.hw.mes.api.domain.MesPurchaseOrder;
import com.hw.mes.domain.*; import com.hw.mes.domain.*;
import com.hw.mes.mapper.MesBaseMaterialInfoMapper; import com.hw.mes.mapper.*;
import com.hw.mes.mapper.MesBaseUnitInfoMapper;
import com.hw.mes.mapper.MesMaterialBomMapper;
import com.hw.mes.service.*; import com.hw.mes.service.*;
import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.*;
import org.apache.poi.util.IOUtils; import org.apache.poi.util.IOUtils;
@ -68,6 +67,12 @@ public class MesImportImpl implements IMesImportService {
@Autowired @Autowired
private IMesPurchaseApplyProcessService mesPurchaseApplyProcessService; private IMesPurchaseApplyProcessService mesPurchaseApplyProcessService;
@Autowired
private MesSaleOrderMapper mesSaleOrderMapper;
@Autowired
private MesPurchaseOrderMapper mesPurchaseOrderMapper;
private static final Logger log = LoggerFactory.getLogger(MesImportImpl.class); private static final Logger log = LoggerFactory.getLogger(MesImportImpl.class);
/** /**
@ -446,4 +451,175 @@ public class MesImportImpl implements IMesImportService {
return "导入成功"; 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.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.alibaba.fastjson2.JSONObject;
import com.hw.common.core.constant.MesConstants; 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.exception.ServiceException;
import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils; 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.MesProductPlanMapper;
import com.hw.mes.mapper.MesSaleOrderMapper; import com.hw.mes.mapper.MesSaleOrderMapper;
import com.hw.mes.service.IMesMaterialBomService; 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.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; 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.domain.MesProductOrder;
import com.hw.mes.service.IMesProductOrderService; import com.hw.mes.service.IMesProductOrderService;
import javax.annotation.Resource;
import static com.hw.common.core.utils.DateUtils.YYYY_MM_DD_HH_MM_SS; import static com.hw.common.core.utils.DateUtils.YYYY_MM_DD_HH_MM_SS;
/** /**
@ -49,6 +56,9 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
@Autowired @Autowired
private MesSaleOrderMapper mesSaleOrderMapper; 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) { for (MesProductPlanDetail mesProductPlanDetail : mesProductPlanDetailList) {
MesProductPlan mesProductPlan = mesProductPlanMapper.selectOnlyMesProductPlanByPlanId(mesProductPlanDetail.getPlanId()); MesProductPlan mesProductPlan = mesProductPlanMapper.selectOnlyMesProductPlanByPlanId(mesProductPlanDetail.getPlanId());
//易耗品标识,分摊到各个生产计划明细中
//计算工时 //计算工时
Date realBeginTime = mesProductPlanDetail.getRealBeginTime(); Date realBeginTime = mesProductPlanDetail.getRealBeginTime();
Date realEndTime = mesProductPlanDetail.getRealEndTime(); Date realEndTime = mesProductPlanDetail.getRealEndTime();
@ -880,6 +877,8 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
MesProduceStatisticsDetail mesProduceStatisticsDetail = new MesProduceStatisticsDetail(); MesProduceStatisticsDetail mesProduceStatisticsDetail = new MesProduceStatisticsDetail();
mesProduceStatisticsDetail.setProductOrderId(mesProductPlan.getProductOrderId()); mesProduceStatisticsDetail.setProductOrderId(mesProductPlan.getProductOrderId());
mesProduceStatisticsDetail.setDispatchType(mesProductPlan.getDispatchType());
mesProduceStatisticsDetail.setDispatchId(mesProductPlan.getDispatchId());
mesProduceStatisticsDetail.setSaleOrderId(mesProductPlan.getSaleOrderId()); mesProduceStatisticsDetail.setSaleOrderId(mesProductPlan.getSaleOrderId());
mesProduceStatisticsDetail.setSaleorderCode(mesProductPlan.getSaleorderCode()); mesProduceStatisticsDetail.setSaleorderCode(mesProductPlan.getSaleorderCode());
mesProduceStatisticsDetail.setPlanId(mesProductPlanDetail.getPlanId()); 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() { // public String executeAssignTaskResultTask() {
// ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); // ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
// boolean running = true; // boolean running = true;

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

@ -6,9 +6,11 @@ import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.alibaba.fastjson2.JSONObject;
import com.hw.common.core.constant.Constants; import com.hw.common.core.constant.Constants;
import com.hw.common.core.constant.MesConstants; import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.constant.SecurityConstants; 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.domain.R;
import com.hw.common.core.exception.ServiceException; import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils; 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.MesBaseMaterialInfo;
import com.hw.mes.api.domain.MesOrderBind; import com.hw.mes.api.domain.MesOrderBind;
import com.hw.mes.api.domain.MesSaleOrderRelate; import com.hw.mes.api.domain.MesSaleOrderRelate;
import com.hw.mes.domain.MesProductOrder;
import com.hw.mes.domain.MesSaleOrder; import com.hw.mes.domain.MesSaleOrder;
import com.hw.mes.mapper.*; 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.RemoteWmsService;
import com.hw.wms.api.domain.vo.WmsAutoOutstockVo; import com.hw.wms.api.domain.vo.WmsAutoOutstockVo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -55,6 +60,10 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
@Resource @Resource
private RemoteWmsService remoteWmsService; private RemoteWmsService remoteWmsService;
@Resource
private RemoteSysCommonService remoteSysCommonService;
/** /**
* *
* *
@ -611,4 +620,51 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
mesPurchaseOrder.setBindFlag("1"); mesPurchaseOrder.setBindFlag("1");
return mesPurchaseOrderMapper.selectMesPurchaseOrderJoinList(mesPurchaseOrder); 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.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; 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.exception.ServiceException;
import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils; import com.hw.common.core.utils.StringUtils;
import com.hw.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseMaterialInfo; 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.MesSaleOrderRelate;
import com.hw.mes.api.domain.vo.MesBaseBarcodeInfoTransferVo; import com.hw.mes.api.domain.vo.MesBaseBarcodeInfoTransferVo;
import com.hw.mes.api.domain.vo.MesSaleOrderTransferVo; import com.hw.mes.api.domain.vo.MesSaleOrderTransferVo;
import com.hw.mes.domain.MesMaterialBom; import com.hw.mes.domain.MesMaterialBom;
import com.hw.mes.domain.MesSaleOrderMaterial; import com.hw.mes.domain.MesSaleOrderMaterial;
import com.hw.mes.mapper.*; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.hw.mes.domain.MesSaleOrder; import com.hw.mes.domain.MesSaleOrder;
import com.hw.mes.service.IMesSaleOrderService; import com.hw.mes.service.IMesSaleOrderService;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/** /**
* Service * Service
* *
@ -49,6 +59,9 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService {
@Autowired @Autowired
private MesSaleOrderMaterialMapper mesSaleOrderMaterialMapper; private MesSaleOrderMaterialMapper mesSaleOrderMaterialMapper;
@Resource
private RemoteSysCommonService remoteSysCommonService;
/** /**
* *
* *
@ -292,9 +305,9 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService {
for (MesSaleOrderMaterial mesSaleOrderMaterial : mesSaleOrderMaterialList) { for (MesSaleOrderMaterial mesSaleOrderMaterial : mesSaleOrderMaterialList) {
if (mesSaleOrderMaterial.getUsedAmount() != null && mesSaleOrderMaterial.getUsedAmount().compareTo(BigDecimal.ZERO) > 0) { if (mesSaleOrderMaterial.getUsedAmount() != null && mesSaleOrderMaterial.getUsedAmount().compareTo(BigDecimal.ZERO) > 0) {
BigDecimal realOutstockAmount = mesSaleOrderMaterial.getRealOutstockAmount(); BigDecimal realOutstockAmount = mesSaleOrderMaterial.getRealOutstockAmount();
BigDecimal totalUsedAmount = mesSaleOrderMaterial.getTotalUsedAmount()==null?BigDecimal.ZERO:mesSaleOrderMaterial.getTotalUsedAmount();//其他订单已分摊数量 BigDecimal totalUsedAmount = mesSaleOrderMaterial.getTotalUsedAmount() == null ? BigDecimal.ZERO : mesSaleOrderMaterial.getTotalUsedAmount();//其他订单已分摊数量
BigDecimal oriUsedAmount = mesSaleOrderMaterial.getOriUsedAmount()==null?BigDecimal.ZERO:mesSaleOrderMaterial.getOriUsedAmount(); BigDecimal oriUsedAmount = mesSaleOrderMaterial.getOriUsedAmount() == null ? BigDecimal.ZERO : mesSaleOrderMaterial.getOriUsedAmount();
BigDecimal usedAmount = mesSaleOrderMaterial.getUsedAmount()==null?BigDecimal.ZERO:mesSaleOrderMaterial.getUsedAmount(); BigDecimal usedAmount = mesSaleOrderMaterial.getUsedAmount() == null ? BigDecimal.ZERO : mesSaleOrderMaterial.getUsedAmount();
BigDecimal updateAmount = usedAmount.subtract(oriUsedAmount);//修改的数量差 BigDecimal updateAmount = usedAmount.subtract(oriUsedAmount);//修改的数量差
if (updateAmount.compareTo(BigDecimal.ZERO) != 0) { if (updateAmount.compareTo(BigDecimal.ZERO) != 0) {
BigDecimal newTotalUsedAmount = totalUsedAmount.add(usedAmount); BigDecimal newTotalUsedAmount = totalUsedAmount.add(usedAmount);
@ -306,8 +319,8 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService {
if (mesSaleOrderMaterial.getSaleOrderMaterialId() != null) { if (mesSaleOrderMaterial.getSaleOrderMaterialId() != null) {
// toUpdatedMesSaleOrderMateriaList.add(mesSaleOrderMaterial); // toUpdatedMesSaleOrderMateriaList.add(mesSaleOrderMaterial);
mesSaleOrderMaterial.setUpdateBy(nickName); mesSaleOrderMaterial.setUpdateBy(nickName);
mesSaleOrderMaterial.setUpdateTime(currentDate); mesSaleOrderMaterial.setUpdateTime(currentDate);
mesSaleOrderMaterialMapper.updateMesSaleOrderMaterial(mesSaleOrderMaterial); mesSaleOrderMaterialMapper.updateMesSaleOrderMaterial(mesSaleOrderMaterial);
} else { } else {
@ -326,4 +339,49 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService {
return 1; 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="projectId != null ">and project_id = #{projectId}</if>
<if test="activeFlag != null and activeFlag != ''">and active_flag = #{activeFlag}</if> <if test="activeFlag != null and activeFlag != ''">and active_flag = #{activeFlag}</if>
</where> </where>
order by material_id, create_time desc order by material_bom_id desc
</select> </select>
<select id="selectMesMaterialBomByMaterialBomId" parameterType="Long" resultMap="MesMaterialBomResult"> <select id="selectMesMaterialBomByMaterialBomId" parameterType="Long" resultMap="MesMaterialBomResult">

@ -7,6 +7,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="MesProduceStatisticsDetail" id="MesProduceStatisticsDetailResult"> <resultMap type="MesProduceStatisticsDetail" id="MesProduceStatisticsDetailResult">
<result property="statisticsDetailId" column="statistics_detail_id" /> <result property="statisticsDetailId" column="statistics_detail_id" />
<result property="productOrderId" column="product_order_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="saleOrderId" column="sale_order_id" />
<result property="saleorderCode" column="saleorder_code" /> <result property="saleorderCode" column="saleorder_code" />
<result property="planId" column="plan_id" /> <result property="planId" column="plan_id" />
@ -44,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectMesProduceStatisticsDetailVo"> <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> </sql>
<select id="selectMesProduceStatisticsDetailList" parameterType="MesProduceStatisticsDetail" resultMap="MesProduceStatisticsDetailResult"> <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 insert into mes_produce_statistics_detail
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="productOrderId != null">product_order_id,</if> <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="saleOrderId != null">sale_order_id,</if>
<if test="saleorderCode != null">saleorder_code,</if> <if test="saleorderCode != null">saleorder_code,</if>
<if test="planId != null">plan_id,</if> <if test="planId != null">plan_id,</if>
@ -108,6 +112,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productOrderId != null">#{productOrderId},</if> <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="saleOrderId != null">#{saleOrderId},</if>
<if test="saleorderCode != null">#{saleorderCode},</if> <if test="saleorderCode != null">#{saleorderCode},</if>
<if test="planId != null">#{planId},</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}) ( #{item.statisticsDetailMaterialId}, #{item.statisticsDetailId}, #{item.materialId}, #{item.materialCode}, #{item.materialName}, #{item.materialSpec}, #{item.usedAmount})
</foreach> </foreach>
</insert> </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> </mapper>

@ -382,6 +382,9 @@
<if test="params.planBeginTime != null and params.planEndTime != null"> <if test="params.planBeginTime != null and params.planEndTime != null">
AND (plan_begin_time &lt;= #{params.planEndTime} AND plan_end_time &gt;= #{params.planBeginTime}) AND (plan_begin_time &lt;= #{params.planEndTime} AND plan_end_time &gt;= #{params.planBeginTime})
</if> </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> </where>
order by mpo.product_order_id desc order by mpo.product_order_id desc
</select> </select>
@ -395,7 +398,7 @@
FROM mes_product_order FROM mes_product_order
WHERE plan_begin_time = (select max(plan_begin_time) FROM mes_product_order) order by product_order_id desc limit 1 WHERE plan_begin_time = (select max(plan_begin_time) FROM mes_product_order) order by product_order_id desc limit 1
</select> </select>
<select id="getLineStatus" resultType="java.lang.Boolean"> <select id="getLineStatus" resultType="java.lang.String">
SELECT x.status_value FROM `hwjy-cloud`.dms_realtime_status x where x.status_name = '烘干机风机状态' SELECT x.status_value FROM `hwjy-cloud`.dms_realtime_status x where x.status_name = '烘干机风机状态'
</select> </select>
<select id="getHourProduction" resultType="java.util.Map"> <select id="getHourProduction" resultType="java.util.Map">
@ -405,7 +408,7 @@
from from
wms_product_instock wms_product_instock
where where
begin_time > now() -interval 6 hour and warehouse_id = 231 begin_time > now() -interval 24 hour and warehouse_id = 231
group by hour order by hour asc group by hour order by hour asc
</select> </select>
<select id="getDayProduction" resultType="java.util.Map"> <select id="getDayProduction" resultType="java.util.Map">
@ -423,7 +426,7 @@
</select> </select>
<select id="deviceTimeCount" resultType="com.hw.mes.board.domain.DmsRealtimeStatusHistory"> <select id="deviceTimeCount" resultType="com.hw.mes.board.domain.DmsRealtimeStatusHistory">
select select
DATE_FORMAT(sync_time , '%Y-%m-%d %H:00:00') hour,count(1)*10 timeCount DATE_FORMAT(sync_time , '%Y-%m-%d %H:00:00') hour,count(1) timeCount
from from
dms_realtime_status_history dms_realtime_status_history
where where
@ -503,6 +506,40 @@
<select id="thirdOrderPlan" resultType="com.hw.mes.domain.MesProductOrder"> <select id="thirdOrderPlan" resultType="com.hw.mes.domain.MesProductOrder">
SELECT x.* FROM `hwjy-cloud`.mes_product_order x where x.plan_begin_time > now() - interval 1 month order by plan_begin_time asc SELECT x.* FROM `hwjy-cloud`.mes_product_order x where x.plan_begin_time > now() - interval 1 month order by plan_begin_time asc
</select> </select>
<select id="orderTime" resultType="com.hw.mes.domain.MesProduceStatisticsDetail">
select
a.product_order_id,
a.process_id,
sum(a.produce_time) produce_time,b.process_name,a.real_begin_time ,a.real_end_time
from
mes_produce_statistics_detail a left join mes_base_process_info b on a.process_id = b.process_id
where
a.product_order_id in (
select
product_order_id
from
mes_produce_statistics_detail
where
real_begin_time =
(
select
max(real_begin_time) real_begin_time
from mes_produce_statistics_detail) group by product_order_id) group by a.real_begin_time ,a.real_end_time,a.process_id ,a.product_order_id
</select>
<select id="orderEfficiency" resultType="com.hw.mes.domain.MesProduceStatisticsDetail">
select
a.plan_code ,
a.product_order_id,
a.process_id,
ifnull(sum(timediff(a.plan_end_time, a.plan_begin_time)),0) / sum(a.produce_time) efficiency,b.process_name
from
mes_produce_statistics_detail a join mes_base_process_info b on a.process_id = b.process_id
where
a.real_begin_time > now() - interval 1 month and a.dispatch_id = 4 group by a.process_id ,a.product_order_id,a.plan_code
</select>
<select id="getLineThirdStatus" resultType="java.lang.String">
SELECT x.status_value FROM `hwjy-cloud`.dms_realtime_status x where x.status_name = '烘干机螺旋状态'
</select>
<!--查询24小时内每小时的最新一条数据--> <!--查询24小时内每小时的最新一条数据-->
<!-- SELECT--> <!-- SELECT-->
<!-- mes_product_order.*--> <!-- mes_product_order.*-->

@ -56,6 +56,8 @@
<result property="nickName" column="nick_name"/> <result property="nickName" column="nick_name"/>
<result property="cabinetChannel" column="cabinet_channel"/> <result property="cabinetChannel" column="cabinet_channel"/>
<result property="productId" column="product_id"/> <result property="productId" column="product_id"/>
<result property="dispatchType" column="dispatch_type"/>
<result property="dispatchId" column="dispatch_id"/>
</resultMap> </resultMap>
<resultMap id="MesProductPlanMesProductPlanDetailResult" type="MesProductPlan" extends="MesProductPlanResult"> <resultMap id="MesProductPlanMesProductPlanDetailResult" type="MesProductPlan" extends="MesProductPlanResult">
@ -580,9 +582,89 @@
a.update_by, a.update_by,
a.update_time, a.update_time,
b.sale_order_id, 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 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} where a.plan_id = #{planId}
</select> </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> </mapper>

@ -67,6 +67,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
parameterType="java.lang.Long"> parameterType="java.lang.Long">
select * from mes_production_qualified where qualified_id = #{qualifiedId} select * from mes_production_qualified where qualified_id = #{qualifiedId}
</select> </select>
<select id="productionQualified" resultType="com.hw.mes.domain.MesProductionQualified">
SELECT x.* FROM `hwjy-cloud`.mes_production_qualified x where DATE(X.create_time) = curdate()
</select>
<insert id="insertMesAlarmInfo" parameterType="MesAlarmInfo" useGeneratedKeys="true" keyProperty="alarmInfoId"> <insert id="insertMesAlarmInfo" parameterType="MesAlarmInfo" useGeneratedKeys="true" keyProperty="alarmInfoId">
insert into mes_alarm_info insert into mes_alarm_info

@ -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="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="tondBase != null and tondBase != ''"> and tond_base like concat('%', #{tondBase}, '%')</if>
<if test="orderStatusStr != null and orderStatusStr != ''"> and order_status in (${orderStatusStr})</if>
</where> </where>
</select> </select>

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

@ -0,0 +1,51 @@
package com.hw.wms.board.controller;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.wms.board.service.FirstWmsBorderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("FirstWmsBorder")
public class FirstWmsBorderController {
@Autowired
private FirstWmsBorderService firstWmsBorderService;
/**
*
*/
@GetMapping("/inAndOutInfo")
public AjaxResult inAndOutInfo(){
return AjaxResult.success(firstWmsBorderService.inAndOutInfo());
}
/**
*
*/
@GetMapping("stockPercentage")
public AjaxResult stockPercentage(){
return AjaxResult.success(firstWmsBorderService.stockPercentage());
}
/**
*
*/
@GetMapping("purchaseInfo")
public AjaxResult purchaseInfo(){
return AjaxResult.success(firstWmsBorderService.purchaseInfo());
}
/**
*
*/
@GetMapping("/bomInfo")
public AjaxResult bomInfo(){
return AjaxResult.success(firstWmsBorderService.bomInfo());
}
/**
*
*/
@GetMapping("/productInAndOutInfo")
public AjaxResult productInAndOutInfo(){
return AjaxResult.success(firstWmsBorderService.productInAndOutInfo());
}
}

@ -0,0 +1,52 @@
package com.hw.wms.board.controller;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.wms.board.service.FirstWmsBorderService;
import com.hw.wms.board.service.FourthWmsBorderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("FourthWmsBorder")
public class FourthWmsBorderController {
@Autowired
private FourthWmsBorderService fouthWmsBorderService;
/**
*
*/
@GetMapping("/inAndOutInfo")
public AjaxResult inAndOutInfo(){
return AjaxResult.success(fouthWmsBorderService.inAndOutInfo());
}
/**
*
*/
@GetMapping("stockPercentage")
public AjaxResult stockPercentage(){
return AjaxResult.success(fouthWmsBorderService.stockPercentage());
}
/**
*
*/
@GetMapping("/productInAndOutInfo")
public AjaxResult productInAndOutInfo(){
return AjaxResult.success(fouthWmsBorderService.productInAndOutInfo());
}
/**
*
*/
@GetMapping("purchaseInfo")
public AjaxResult purchaseInfo(){
return AjaxResult.success(fouthWmsBorderService.purchaseInfo());
}
/**
*
*/
@GetMapping("/bomInfo")
public AjaxResult bomInfo(){
return AjaxResult.success(fouthWmsBorderService.bomInfo());
}
}

@ -0,0 +1,24 @@
package com.hw.wms.board.service;
import com.hw.wms.domain.MesProductOrder;
import com.hw.wms.domain.WmsBaseLocation;
import com.hw.wms.domain.WmsProductInstock;
import com.hw.wms.domain.WmsRawInstock;
import java.util.List;
import java.util.Map;
public interface FirstWmsBorderService {
Map inAndOutInfo();
Map stockPercentage();
List<WmsRawInstock> purchaseInfo();
List<MesProductOrder> bomInfo();
List<WmsProductInstock> productInAndOutInfo();
}

@ -0,0 +1,23 @@
package com.hw.wms.board.service;
import com.hw.wms.domain.MesProductOrder;
import com.hw.wms.domain.WmsProductInstock;
import com.hw.wms.domain.WmsRawInstock;
import java.util.List;
import java.util.Map;
public interface FourthWmsBorderService {
Map inAndOutInfo();
Map stockPercentage();
List<WmsProductInstock> productInAndOutInfo();
List<WmsRawInstock> purchaseInfo();
List<MesProductOrder> bomInfo();
}

@ -22,5 +22,5 @@ public interface SecondWmsBorderService {
Map<String,Integer> instockTimeCount(); Map<String,Integer> instockTimeCount();
BigDecimal todayInstockAmount(); Map<String, BigDecimal> todayInstockAmount();
} }

@ -0,0 +1,74 @@
package com.hw.wms.board.service.impl;
import com.hw.wms.board.service.FifthWmsBorderService;
import com.hw.wms.board.service.FirstWmsBorderService;
import com.hw.wms.domain.*;
import com.hw.wms.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class FirstWmsBoardServiceImpl implements FirstWmsBorderService {
@Autowired
private WmsRawOutstockMapper wmsRawOutstockMapper;
@Autowired
private WmsRawInstockMapper wmsRawInstockMapper;
@Autowired
private WmsBaseLocationMapper wmsBaseLocationMapper;
@Autowired
private WmsProductInstockMapper wmsProductInstockMapper;
@Override
public Map inAndOutInfo() {
List<WmsRawOutstock> rawOutstocks = wmsRawOutstockMapper.selectInAndOutInfo();
List<WmsRawOutstock> inStocks = wmsRawInstockMapper.selectInAndOutInfo();
HashMap<String, List<WmsRawOutstock>> map = new HashMap<>();
map.put("rawOutstocks",rawOutstocks);
map.put("inStocks",inStocks);
return map;
}
@Override
public Map stockPercentage() {
int stockAmount = wmsBaseLocationMapper.stockAmount();
int nostockAmount = wmsBaseLocationMapper.nostockAmount();
int productstockAmount = wmsBaseLocationMapper.productstockAmount();
int noProductstockAmount = wmsBaseLocationMapper.noProductstockAmount();
HashMap<String, Integer> map = new HashMap<>();
map.put("stockAmount",stockAmount);
map.put("nostockAmount",nostockAmount);
map.put("productstockAmount",productstockAmount);
map.put("noProductstockAmount",noProductstockAmount);
return map;
}
@Override
public List<WmsProductInstock> productInAndOutInfo() {
List<WmsProductInstock> instocks = wmsProductInstockMapper.productFirstInInfo();
List<WmsProductInstock> outstocks = wmsRawOutstockMapper.productFirstOutInfo();
for (WmsProductInstock instock : instocks) {
for (WmsProductInstock outstock : outstocks) {
if (instock.getDay().equals(outstock.getDay())){
instock.setOutStockAmount(outstock.getInstockAmount());
}
}
}
return instocks;
}
@Override
public List<MesProductOrder> bomInfo() {
return wmsRawInstockMapper.bomInfo(1);
}
@Override
public List<WmsRawInstock> purchaseInfo() {
return wmsRawInstockMapper.purchaseInfo();
}
}

@ -0,0 +1,77 @@
package com.hw.wms.board.service.impl;
import com.hw.wms.board.service.FirstWmsBorderService;
import com.hw.wms.board.service.FourthWmsBorderService;
import com.hw.wms.domain.MesProductOrder;
import com.hw.wms.domain.WmsProductInstock;
import com.hw.wms.domain.WmsRawInstock;
import com.hw.wms.domain.WmsRawOutstock;
import com.hw.wms.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class FouthWmsBoardServiceImpl implements FourthWmsBorderService {
@Autowired
private WmsRawOutstockMapper wmsRawOutstockMapper;
@Autowired
private WmsRawInstockMapper wmsRawInstockMapper;
@Autowired
private WmsBaseLocationMapper wmsBaseLocationMapper;
@Autowired
private WmsProductInstockMapper wmsProductInstockMapper;
@Autowired
private WmsProductOutstockMapper wmsProductOutstockMapper;
@Override
public Map inAndOutInfo() {
List<WmsRawOutstock> rawOutstock = wmsRawOutstockMapper.fourthOutstockList();
List<WmsRawOutstock> inStocks = wmsRawInstockMapper.fourthInstockList();
HashMap<String, List<WmsRawOutstock>> map = new HashMap<>();
map.put("rawOutstock",rawOutstock);
map.put("inStocks",inStocks);
return map;
}
@Override
public Map stockPercentage() {
Integer stockAmount = wmsBaseLocationMapper.selectFourthLocation();
Integer nostockAmount = wmsBaseLocationMapper.selectFourthNostockLocation();
Integer fustockLocation = wmsBaseLocationMapper.selectFourthFustockLocation();
Integer noFustockLocation = wmsBaseLocationMapper.selectFourthNoFustockLocation();
HashMap<String, Integer> map = new HashMap<>();
map.put("stockAmount",stockAmount);
map.put("nostockAmount",nostockAmount);
map.put("fustockLocation",fustockLocation);
map.put("noFustockLocation",noFustockLocation);
return map;
}
@Override
public List<MesProductOrder> bomInfo() {
return wmsRawInstockMapper.bomInfo(3);
}
@Override
public List<WmsRawInstock> purchaseInfo() {
return wmsRawInstockMapper.purchaseFirstInfo();
}
@Override
public List<WmsProductInstock> productInAndOutInfo() {
List<WmsProductInstock> instocks = wmsProductInstockMapper.productInInfo();
List<WmsProductInstock> outstocks = wmsRawOutstockMapper.productOutInfo();
for (WmsProductInstock instock : instocks) {
for (WmsProductInstock outstock : outstocks) {
if (instock.getDay().equals(outstock.getDay())){
instock.setOutStockAmount(outstock.getInstockAmount());
}
}
}
return instocks;
}
}

@ -5,6 +5,8 @@ import com.hw.wms.domain.WmsProductInstock;
import com.hw.wms.domain.WmsProductOutstock; import com.hw.wms.domain.WmsProductOutstock;
import com.hw.wms.domain.WmsProductOutstockDetail; import com.hw.wms.domain.WmsProductOutstockDetail;
import com.hw.wms.domain.WmsProductStock; import com.hw.wms.domain.WmsProductStock;
import com.hw.wms.mapper.WmsProductInstockMapper;
import com.hw.wms.mapper.WmsProductOutstockMapper;
import com.hw.wms.mapper.WmsProductStockMapper; import com.hw.wms.mapper.WmsProductStockMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -20,6 +22,8 @@ import java.util.stream.Collectors;
public class SecondWmsBoardServiceImpl implements SecondWmsBorderService { public class SecondWmsBoardServiceImpl implements SecondWmsBorderService {
@Autowired @Autowired
private WmsProductStockMapper wmsProductStockMapper; private WmsProductStockMapper wmsProductStockMapper;
@Autowired
private WmsProductOutstockMapper wmsProductOutstockMapper;
@Override @Override
public List<WmsProductStock> totalStock() { public List<WmsProductStock> totalStock() {
@ -27,9 +31,17 @@ public class SecondWmsBoardServiceImpl implements SecondWmsBorderService {
} }
@Override @Override
public BigDecimal todayInstockAmount() { public Map<String, BigDecimal> todayInstockAmount() {
BigDecimal result = wmsProductStockMapper.todayInstockAmount(); BigDecimal dayInstockAmount = wmsProductStockMapper.todayInstockAmount();
return result; BigDecimal dayOutstockAmount = wmsProductOutstockMapper.todayOutstockAmount();
BigDecimal monthInstockAmount = wmsProductStockMapper.monthInstockAmount();
BigDecimal monthOutstockAmount = wmsProductOutstockMapper.monthOutstockAmount();
HashMap<String, BigDecimal> map = new HashMap<>();
map.put("dayInstockAmount",dayInstockAmount);
map.put("dayOutstockAmount",dayOutstockAmount);
map.put("monthInstockAmount",monthInstockAmount);
map.put("monthOutstockAmount",monthOutstockAmount);
return map;
} }
@Override @Override

@ -27,9 +27,13 @@ public class ThirdWmsBorderServiceImpl implements ThirdWmsBorderService {
public Map monthRawAmount() { public Map monthRawAmount() {
BigDecimal monthRawInAmount = wmsRawInstockMapper.monthRawInAmount(); BigDecimal monthRawInAmount = wmsRawInstockMapper.monthRawInAmount();
BigDecimal monthRawOutAmount = wmsRawOutstockMapper.monthRawOutAmount(); BigDecimal monthRawOutAmount = wmsRawOutstockMapper.monthRawOutAmount();
BigDecimal dayRawInAmount = wmsRawInstockMapper.dayRawInAmount();
BigDecimal dayRawOutAmount = wmsRawOutstockMapper.dayRawOutAmount();
HashMap hashMap = new HashMap(); HashMap hashMap = new HashMap();
hashMap.put("monthRawInAmount",monthRawInAmount); hashMap.put("monthRawInAmount",monthRawInAmount);
hashMap.put("monthRawOutAmount",monthRawOutAmount); hashMap.put("monthRawOutAmount",monthRawOutAmount);
hashMap.put("dayRawInAmount",dayRawInAmount);
hashMap.put("dayRawOutAmount",dayRawOutAmount);
return hashMap; return hashMap;
} }

@ -0,0 +1,609 @@
package com.hw.wms.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* mes_product_order
*
* @author Yinq
* @date 2024-02-20
*/
public class MesProductOrder extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long productOrderId;
/**
*
*/
@Excel(name = "工单编号")
private String orderCode;
/**
* ID,mes_sale_orderorder_id;
*/
@Excel(name = "销售订单ID")
private Long saleOrderId;
/**
*
*/
@Excel(name = "销售订单编号")
private String saleorderCode;
/**
*
*/
@Excel(name = "销售订单行号")
private String saleorderLinenumber;
/**
*
*/
@Excel(name = "项目编号")
private String projectNo;
/**
*
*/
@Excel(name = "销售类型1外部销售 2对内生产 3集装箱生产)")
private String saleType;
/**
* ID,mes_base_material_infomaterial_id;
*/
@Excel(name = "物料ID")
private Long materialId;
/**
* bomIDmes_material_bommaterial_bom_id;bom
*/
@Excel(name = "物料bomID")
private Long materialBomId;
/**对内生产生产的实际物料信息*/
private Long produceMaterialId;
/**
* BOM
*/
@Excel(name = "BOM说明")
private String materialBomDesc;
/**
* (1线 2线)
*/
@Excel(name = "派工类型")
private String dispatchType;
/**
* ID线线线线
*/
@Excel(name = "派工ID")
private Long dispatchId;
/**
*
*/
private String cabinetChannel;
/**
* ;
*/
@Excel(name = "销售数量")
private BigDecimal saleAmount;
/**
*
*/
@Excel(name = "计划数量")
private BigDecimal planAmount;
/**
* ;线线
*/
@Excel(name = "已派工数量")
private BigDecimal dispatchAmount;
/**
*
*/
@Excel(name = "完成数量")
private BigDecimal completeAmount;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date releaseTime;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "计划开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date planBeginTime;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "计划结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date planEndTime;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date realBeginTime;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date realEndTime;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "计划交货日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date planDeliveryDate;
/**
* 0-1-2-3-4-8-9-
*/
@Excel(name = "工单状态")
private String orderStatus;
/**
* 1-0-
*/
@Excel(name = "库存锁定标识")
private String stockLockFlag;
/**
* 1=;0=
*/
private String saleOrderFlag;
/**
* 线
*/
@Excel(name = "工艺路线名称")
private String dispatchName;
/**
*
*/
@Excel(name = "成品编号")
private String materialCode;
/**
*
*/
@Excel(name = "成品名称")
private String materialName;
/**
*
*/
private String materialSpec;
/**
*
*/
private String produceMaterialCode;
/**
*
*/
private String produceMaterialName;
/**
*
*/
private String produceMaterialSpec;
/**
*
*/
@Excel(name = "单位时间")
private Long productionTime;
/**
* ID
*/
@Excel(name = "前置生产工单ID")
private Long preOrderId;
/**
*
*/
@Excel(name = "前置生产工单编号")
private String preOrderCode;
/** MesProductPlan主键标识 */
private Long planId;
/**
* MesProductPlan
*/
private String planCode;
/**
* -
*/
private List<String> planDateRange;
public List<String> getPlanDateRange() {
return planDateRange;
}
public void setPlanDateRange(List<String> planDateRange) {
this.planDateRange = planDateRange;
}
public Long getPlanId() {
return planId;
}
public void setPlanId(Long planId) {
this.planId = planId;
}
public String getPlanCode() {
return planCode;
}
public void setPlanCode(String planCode) {
this.planCode = planCode;
}
public String getPreOrderCode() {
return preOrderCode;
}
public void setPreOrderCode(String preOrderCode) {
this.preOrderCode = preOrderCode;
}
public Long getPreOrderId() {
return preOrderId;
}
public void setPreOrderId(Long preOrderId) {
this.preOrderId = preOrderId;
}
public Long getProductionTime() {
return productionTime;
}
public void setProductionTime(Long productionTime) {
this.productionTime = productionTime;
}
public String getMaterialBomDesc() {
return materialBomDesc;
}
public void setMaterialBomDesc(String materialBomDesc) {
this.materialBomDesc = materialBomDesc;
}
public String getDispatchName() {
return dispatchName;
}
public void setDispatchName(String dispatchName) {
this.dispatchName = dispatchName;
}
public Date getPlanDeliveryDate() {
return planDeliveryDate;
}
public void setPlanDeliveryDate(Date planDeliveryDate) {
this.planDeliveryDate = planDeliveryDate;
}
public String getSaleOrderFlag() {
return saleOrderFlag;
}
public void setSaleOrderFlag(String saleOrderFlag) {
this.saleOrderFlag = saleOrderFlag;
}
public void setProductOrderId(Long productOrderId) {
this.productOrderId = productOrderId;
}
public Long getProductOrderId() {
return productOrderId;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
public void setSaleOrderId(Long saleOrderId) {
this.saleOrderId = saleOrderId;
}
public Long getSaleOrderId() {
return saleOrderId;
}
public void setSaleorderCode(String saleorderCode) {
this.saleorderCode = saleorderCode;
}
public String getSaleorderCode() {
return saleorderCode;
}
public void setSaleorderLinenumber(String saleorderLinenumber) {
this.saleorderLinenumber = saleorderLinenumber;
}
public String getSaleorderLinenumber() {
return saleorderLinenumber;
}
public void setProjectNo(String projectNo) {
this.projectNo = projectNo;
}
public String getProjectNo() {
return projectNo;
}
public String getSaleType() {
return saleType;
}
public void setSaleType(String saleType) {
this.saleType = saleType;
}
public void setMaterialId(Long materialId) {
this.materialId = materialId;
}
public Long getMaterialId() {
return materialId;
}
public void setMaterialBomId(Long materialBomId) {
this.materialBomId = materialBomId;
}
public Long getMaterialBomId() {
return materialBomId;
}
public Long getProduceMaterialId() {
return produceMaterialId;
}
public void setProduceMaterialId(Long produceMaterialId) {
this.produceMaterialId = produceMaterialId;
}
public void setDispatchType(String dispatchType) {
this.dispatchType = dispatchType;
}
public String getDispatchType() {
return dispatchType;
}
public void setDispatchId(Long dispatchId) {
this.dispatchId = dispatchId;
}
public Long getDispatchId() {
return dispatchId;
}
public String getCabinetChannel() {
return cabinetChannel;
}
public void setCabinetChannel(String cabinetChannel) {
this.cabinetChannel = cabinetChannel;
}
public void setSaleAmount(BigDecimal saleAmount) {
this.saleAmount = saleAmount;
}
public BigDecimal getSaleAmount() {
return saleAmount;
}
public void setPlanAmount(BigDecimal planAmount) {
this.planAmount = planAmount;
}
public BigDecimal getPlanAmount() {
return planAmount;
}
public void setDispatchAmount(BigDecimal dispatchAmount) {
this.dispatchAmount = dispatchAmount;
}
public BigDecimal getDispatchAmount() {
return dispatchAmount;
}
public void setCompleteAmount(BigDecimal completeAmount) {
this.completeAmount = completeAmount;
}
public BigDecimal getCompleteAmount() {
return completeAmount;
}
public void setReleaseTime(Date releaseTime) {
this.releaseTime = releaseTime;
}
public Date getReleaseTime() {
return releaseTime;
}
public void setPlanBeginTime(Date planBeginTime) {
this.planBeginTime = planBeginTime;
}
public Date getPlanBeginTime() {
return planBeginTime;
}
public void setPlanEndTime(Date planEndTime) {
this.planEndTime = planEndTime;
}
public Date getPlanEndTime() {
return planEndTime;
}
public void setRealBeginTime(Date realBeginTime) {
this.realBeginTime = realBeginTime;
}
public Date getRealBeginTime() {
return realBeginTime;
}
public void setRealEndTime(Date realEndTime) {
this.realEndTime = realEndTime;
}
public Date getRealEndTime() {
return realEndTime;
}
public void setOrderStatus(String orderStatus) {
this.orderStatus = orderStatus;
}
public String getOrderStatus() {
return orderStatus;
}
public void setStockLockFlag(String stockLockFlag) {
this.stockLockFlag = stockLockFlag;
}
public String getStockLockFlag() {
return stockLockFlag;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getMaterialSpec() {
return materialSpec;
}
public void setMaterialSpec(String materialSpec) {
this.materialSpec = materialSpec;
}
public String getProduceMaterialCode() {
return produceMaterialCode;
}
public void setProduceMaterialCode(String produceMaterialCode) {
this.produceMaterialCode = produceMaterialCode;
}
public String getProduceMaterialName() {
return produceMaterialName;
}
public void setProduceMaterialName(String produceMaterialName) {
this.produceMaterialName = produceMaterialName;
}
public String getProduceMaterialSpec() {
return produceMaterialSpec;
}
public void setProduceMaterialSpec(String produceMaterialSpec) {
this.produceMaterialSpec = produceMaterialSpec;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("productOrderId", getProductOrderId())
.append("orderCode", getOrderCode())
.append("saleOrderId", getSaleOrderId())
.append("saleorderCode", getSaleorderCode())
.append("saleorderLinenumber", getSaleorderLinenumber())
.append("projectNo", getProjectNo())
.append("materialId", getMaterialId())
.append("materialBomId", getMaterialBomId())
.append("dispatchType", getDispatchType())
.append("dispatchId", getDispatchId())
.append("saleAmount", getSaleAmount())
.append("planAmount", getPlanAmount())
.append("dispatchAmount", getDispatchAmount())
.append("completeAmount", getCompleteAmount())
.append("releaseTime", getReleaseTime())
.append("planBeginTime", getPlanBeginTime())
.append("planEndTime", getPlanEndTime())
.append("realBeginTime", getRealBeginTime())
.append("realEndTime", getRealEndTime())
.append("orderStatus", getOrderStatus())
.append("stockLockFlag", getStockLockFlag())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -163,6 +163,7 @@ public class WmsProductInstock extends BaseEntity {
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "结束时间;agv处理结束时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "结束时间;agv处理结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date endTime; private Date endTime;
private Date day;
/** 同步ERP状态(0:失败,1成功) */ /** 同步ERP状态(0:失败,1成功) */
@Excel(name = "同步ERP状态(0:失败,1成功)") @Excel(name = "同步ERP状态(0:失败,1成功)")
@ -453,6 +454,13 @@ public class WmsProductInstock extends BaseEntity {
public Date getEndTime() { public Date getEndTime() {
return endTime; return endTime;
} }
public void setDay(Date day) {
this.day = day;
}
public Date getDay() {
return day;
}
public String getErpStatus() { public String getErpStatus() {
return erpStatus; return erpStatus;

@ -101,4 +101,20 @@ public interface WmsBaseLocationMapper
int selectAllProductLocation(); int selectAllProductLocation();
int selectAllProductEmptyLocation(); int selectAllProductEmptyLocation();
int stockAmount();
int nostockAmount();
Integer selectFourthLocation();
Integer selectFourthNostockLocation();
int productstockAmount();
int noProductstockAmount();
Integer selectFourthFustockLocation();
Integer selectFourthNoFustockLocation();
} }

@ -100,4 +100,8 @@ public interface WmsProductInstockMapper
List<WmsProductInstock> selectWmsProductInstockJoinList(WmsProductInstock wmsProductInstock); List<WmsProductInstock> selectWmsProductInstockJoinList(WmsProductInstock wmsProductInstock);
List<WmsProductInstock> locationCount(); List<WmsProductInstock> locationCount();
List<WmsProductInstock> productInInfo();
List<WmsProductInstock> productFirstInInfo();
} }

@ -1,5 +1,6 @@
package com.hw.wms.mapper; package com.hw.wms.mapper;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import com.hw.wms.domain.WmsProductOutstock; import com.hw.wms.domain.WmsProductOutstock;
import com.hw.wms.domain.WmsProductOutstockDetail; import com.hw.wms.domain.WmsProductOutstockDetail;
@ -145,4 +146,8 @@ public interface WmsProductOutstockMapper
List<WmsProductOutstock> locationCount(); List<WmsProductOutstock> locationCount();
List<WmsProductOutstockDetail> scheduleTask(); List<WmsProductOutstockDetail> scheduleTask();
BigDecimal todayOutstockAmount();
BigDecimal monthOutstockAmount();
} }

@ -157,4 +157,6 @@ public interface WmsProductStockMapper
int selectTotalLocation(); int selectTotalLocation();
int selectOpplyLocation(); int selectOpplyLocation();
BigDecimal monthInstockAmount();
} }

@ -3,8 +3,11 @@ package com.hw.wms.mapper;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.util.List;
import com.hw.wms.domain.MesProductOrder;
import com.hw.wms.domain.WmsProductInstock; import com.hw.wms.domain.WmsProductInstock;
import com.hw.wms.domain.WmsRawInstock; import com.hw.wms.domain.WmsRawInstock;
import com.hw.wms.domain.WmsRawOutstock;
import org.apache.ibatis.annotations.Param;
/** /**
* Mapper * Mapper
@ -92,4 +95,16 @@ public interface WmsRawInstockMapper
BigDecimal monthRawInAmount(); BigDecimal monthRawInAmount();
List<WmsRawOutstock> selectInAndOutInfo();
List<WmsRawOutstock> fourthInstockList();
List<WmsRawInstock> purchaseInfo();
List<MesProductOrder> bomInfo(@Param("dispatchId") int dispatchId);
List<WmsRawInstock> purchaseFirstInfo();
BigDecimal dayRawInAmount();
} }

@ -2,6 +2,8 @@ package com.hw.wms.mapper;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.util.List;
import com.hw.wms.domain.WmsProductInstock;
import com.hw.wms.domain.WmsRawOutstock; import com.hw.wms.domain.WmsRawOutstock;
import com.hw.wms.domain.WmsRawOutstockDetail; import com.hw.wms.domain.WmsRawOutstockDetail;
@ -160,4 +162,16 @@ public interface WmsRawOutstockMapper
BigDecimal monthRawOutAmount(); BigDecimal monthRawOutAmount();
List<WmsRawOutstock> productPlan(); List<WmsRawOutstock> productPlan();
List<WmsRawOutstock> selectInAndOutInfo();
List<WmsRawOutstock> fourthOutstockList();
List<WmsProductInstock> productOutInfo();
List<WmsProductInstock> productFirstOutInfo();
BigDecimal dayRawInAmount();
BigDecimal dayRawOutAmount();
} }

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

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

@ -1,4 +1,4 @@
# Tomcat # 测试92服务器
server: server:
port: 7304 port: 7304
@ -15,13 +15,13 @@ spring:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 175.27.215.92:8848 server-addr: 175.27.215.92:8848
namespace: jyhb-test namespace: jyhb100
group: xins1 group: jyhb
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 175.27.215.92:8848 server-addr: 175.27.215.92:8848
namespace: jyhb-test namespace: jyhb100
group: xins1 group: jyhb
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置
@ -29,9 +29,7 @@ spring:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
## 92服务器
## Tomcat
#server: #server:
# port: 7304 # port: 7304
# #
@ -60,3 +58,67 @@ spring:
# # 共享配置 # # 共享配置
# shared-configs: # shared-configs:
# - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} # - 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}

@ -300,7 +300,8 @@
order by location_code order by location_code
</select> </select>
<select id="locationStatus" resultType="com.hw.wms.domain.WmsBaseLocation"> <select id="locationStatus" resultType="com.hw.wms.domain.WmsBaseLocation">
select * from wms_base_location SELECT x.* FROM `hwjy-cloud`.wms_base_location x
where x.warehouse_id = 311
</select> </select>
<select id="selectEmptyLocation" resultType="java.lang.Integer"> <select id="selectEmptyLocation" resultType="java.lang.Integer">
select select
@ -329,6 +330,30 @@
<select id="selectAllProductEmptyLocation" resultType="java.lang.Integer"> <select id="selectAllProductEmptyLocation" resultType="java.lang.Integer">
SELECT x.* FROM `hwjy-cloud`.wms_base_location x where x.warehouse_id = 531 SELECT x.* FROM `hwjy-cloud`.wms_base_location x where x.warehouse_id = 531
</select> </select>
<select id="stockAmount" resultType="java.lang.Integer">
SELECT count(1) FROM `hwjy-cloud`.wms_base_location x where x.container_code is not null and x.warehouse_id = 111
</select>
<select id="nostockAmount" resultType="java.lang.Integer">
SELECT count(1) FROM `hwjy-cloud`.wms_base_location x where x.container_code is null and x.warehouse_id = 111
</select>
<select id="selectFourthLocation" resultType="java.lang.Integer">
SELECT count(1) FROM `hwjy-cloud`.wms_base_location x where x.container_code is not null and x.warehouse_id = 411
</select>
<select id="selectFourthNostockLocation" resultType="java.lang.Integer">
SELECT count(1) FROM `hwjy-cloud`.wms_base_location x where x.container_code is null and x.warehouse_id = 411
</select>
<select id="productstockAmount" resultType="java.lang.Integer">
SELECT count(1) FROM `hwjy-cloud`.wms_base_location x where x.container_code is not null and x.warehouse_id = 131
</select>
<select id="noProductstockAmount" resultType="java.lang.Integer">
SELECT count(1) FROM `hwjy-cloud`.wms_base_location x where x.container_code is null and x.warehouse_id = 131
</select>
<select id="selectFourthFustockLocation" resultType="java.lang.Integer">
SELECT count(1) FROM `hwjy-cloud`.wms_base_location x where x.container_code is not null and x.warehouse_id = 412
</select>
<select id="selectFourthNoFustockLocation" resultType="java.lang.Integer">
SELECT count(1) FROM `hwjy-cloud`.wms_base_location x where x.container_code is null and x.warehouse_id = 412
</select>
</mapper> </mapper>

@ -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.erp_status is null or wpi.erp_status != '1')
and wpi.instock_type = '1' and wpi.instock_type = '1'
and mbmi.material_classfication = '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 != ''"> <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
and wpi.apply_date between #{beginTime} and #{endTime} and wpi.apply_date between #{beginTime} and #{endTime}
</if> </if>
@ -306,4 +307,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
apply_date > now() - interval 1 month apply_date > now() - interval 1 month
and warehouse_id = 531 and warehouse_id = 531
</select> </select>
<select id="productInInfo" resultType="com.hw.wms.domain.WmsProductInstock">
select
date_format(apply_date, '%Y-%m-%d 00:00:00') day,sum(instock_amount) instock_amount
from
`hwjy-cloud`.wms_product_instock
where
apply_date > now() - interval 7 day and warehouse_id = 431
group by
day
</select>
<select id="productFirstInInfo" resultType="com.hw.wms.domain.WmsProductInstock">
select
date_format(apply_date, '%Y-%m-%d 00:00:00') day,sum(instock_amount) instock_amount
from
`hwjy-cloud`.wms_product_instock
where
apply_date > now() - interval 7 day and warehouse_id = 131
group by
day
</select>
</mapper> </mapper>

@ -334,6 +334,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and wpo.apply_qty >= wpo.outstock_qty and wpo.apply_qty >= wpo.outstock_qty
and wpo.outstock_qty > if(wpo.erp_amount is null, 0, wpo.erp_amount) and wpo.outstock_qty > if(wpo.erp_amount is null, 0, wpo.erp_amount)
and mbmi.material_classfication = '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 != ''"> <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
and wpi.apply_date between #{beginTime} and #{endTime} and wpi.apply_date between #{beginTime} and #{endTime}
</if> </if>
@ -413,6 +414,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="scheduleTask" resultType="com.hw.wms.domain.WmsProductOutstockDetail"> <select id="scheduleTask" resultType="com.hw.wms.domain.WmsProductOutstockDetail">
SELECT x.* FROM `hwjy-cloud`.wms_product_outstock_detail x where x.begin_time > now() - interval 1 month SELECT x.* FROM `hwjy-cloud`.wms_product_outstock_detail x where x.begin_time > now() - interval 1 month
</select> </select>
<select id="todayOutstockAmount" resultType="java.math.BigDecimal">
select
ifnull(sum(outstock_qty),0) outstock_qty
from
wms_product_outstock
where
apply_date > now() - interval 24 hour
and warehouse_id = 231
</select>
<select id="monthOutstockAmount" resultType="java.math.BigDecimal">
select
ifnull(sum(outstock_qty),0) outstock_qty
from
wms_product_outstock
where
apply_date > now() - interval 1 month
and warehouse_id = 231
</select>
<update id="auditWmsProductOutstockByTaskCode" parameterType="WmsProductOutstock"> <update id="auditWmsProductOutstockByTaskCode" parameterType="WmsProductOutstock">
update wms_product_outstock update wms_product_outstock

@ -384,7 +384,7 @@
</select> </select>
<select id="todayInstockAmount" resultType="java.math.BigDecimal"> <select id="todayInstockAmount" resultType="java.math.BigDecimal">
select select
* sum(instock_amount) instock_amount
from from
`hwjy-cloud`.wms_product_instock `hwjy-cloud`.wms_product_instock
where where
@ -402,6 +402,15 @@
group by group by
product_id product_id
</select> </select>
<select id="monthInstockAmount" resultType="java.math.BigDecimal">
select
sum(instock_amount) instock_amount
from
`hwjy-cloud`.wms_product_instock
where
warehouse_id = 231
and end_time > now() - interval 1 month
</select>
<!--select id="selectWmsProductStocksBySaleorder" parameterType="WmsProductStock" resultMap="WmsProductStockResult"> <!--select id="selectWmsProductStocksBySaleorder" parameterType="WmsProductStock" resultMap="WmsProductStockResult">

@ -232,9 +232,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and wri.instock_amount > if(wri.erp_amount is null, 0, wri.erp_amount) 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 wri.purchase_order_id is not null and wri.purchase_order_id !=0
and mbmi.material_classfication = '1' and mbmi.material_classfication = '1'
and mbmi.material_unit_id is not null and mbmi.material_unit_id !=''
</select> </select>
<select id="monthRawInAmount" resultType="java.math.BigDecimal"> <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' ) 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
</select> </select>
<select id="locationStatus" resultType="com.hw.wms.domain.WmsBaseLocation"> <select id="locationStatus" resultType="com.hw.wms.domain.WmsBaseLocation">
select * from wms_base_location select * from wms_base_location
@ -252,6 +253,55 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
group by group by
warehouse_id warehouse_id
</select> </select>
<select id="selectInAndOutInfo" resultType="com.hw.wms.domain.WmsRawOutstock">
SELECT x.warehouse_id,sum(x.instock_amount) outstock_amount FROM `hwjy-cloud`.wms_raw_instock x where
(x.warehouse_id = 111
or x.warehouse_id = 132) and DATE(x.apply_date) = curdate() group by x.warehouse_id
</select>
<select id="fourthInstockList" resultType="com.hw.wms.domain.WmsRawOutstock">
SELECT x.warehouse_id,sum(x.instock_amount) outstock_amount FROM `hwjy-cloud`.wms_raw_instock x where
x.warehouse_id = 431
and DATE(x.apply_date) = curdate()
</select>
<select id="purchaseInfo" resultType="com.hw.wms.domain.WmsRawInstock">
select
a.*,b.material_name
from
wms_raw_instock a left join mes_base_material_info b on a.material_id = b.material_id
where
a.warehouse_id = 111
and a.apply_date > now() - interval 1 month
and a.instock_type = '1'
</select>
<select id="bomInfo" resultType="com.hw.wms.domain.MesProductOrder">
select
x.*,a.material_name
from
`hwjy-cloud`.mes_product_order x
left join mes_base_material_info a on
x.material_id = a.material_id
where
X.dispatch_id = #{dispatchId}
and X.sale_type = 1 and X.create_time > now() - interval 1 MONTH
</select>
<select id="purchaseFirstInfo" resultType="com.hw.wms.domain.WmsRawInstock">
select
a.*,b.material_name
from
wms_raw_instock a left join mes_base_material_info b on a.material_id = b.material_id
where
a.warehouse_id = 411
and a.apply_date > now() - interval 1 month
and a.instock_type = '1'
</select>
<select id="dayRawInAmount" resultType="java.math.BigDecimal">
select
sum(instock_amount) inStock
from
wms_raw_instock
where
DATE_FORMAT( apply_date, '%Y%m%d' ) = DATE_FORMAT( CURDATE( ) , '%Y%m%d' ) and warehouse_id = 311
</select>
</mapper> </mapper>

@ -385,6 +385,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and wro.outstock_amount >= wro.real_outstock_amount and wro.outstock_amount >= wro.real_outstock_amount
and wro.real_outstock_amount > if(wro.erp_amount is null, 0, wro.erp_amount) and wro.real_outstock_amount > if(wro.erp_amount is null, 0, wro.erp_amount)
and mbmi.material_classfication = '1' 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="taskTypeStr != null and taskTypeStr != ''"> and wro.task_type in (${taskTypeStr})</if>
<if test="taskType != null and taskType != ''"> and wro.task_type = #{taskType}</if> <if test="taskType != null and taskType != ''"> and wro.task_type = #{taskType}</if>
</where> </where>
@ -396,7 +397,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from from
wms_raw_outstock wms_raw_outstock
where where
DATE_FORMAT( apply_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' ) DATE_FORMAT( apply_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' ) and warehouse_id = 311
</select> </select>
<select id="productPlan" resultType="com.hw.wms.domain.WmsRawOutstock"> <select id="productPlan" resultType="com.hw.wms.domain.WmsRawOutstock">
select * from wms_raw_outstock where warehouse_id = 311 order by apply_date desc limit 100 select * from wms_raw_outstock where warehouse_id = 311 order by apply_date desc limit 100
@ -411,5 +412,56 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
apply_date > now() - interval 1 month apply_date > now() - interval 1 month
and warehouse_id = 512 and warehouse_id = 512
</select> </select>
<select id="selectInAndOutInfo" resultType="com.hw.wms.domain.WmsRawOutstock">
select
x.warehouse_id ,sum(x.outstock_amount) outstock_amount
from
`hwjy-cloud`.wms_raw_outstock x
where
(x.warehouse_id = 111
or x.warehouse_id = 132)
and DATE(x.apply_date) = curdate() group by x.warehouse_id
</select>
<select id="fourthOutstockList" resultType="com.hw.wms.domain.WmsRawOutstock">
select
x.warehouse_id ,sum(x.outstock_amount) outstock_amount
from
`hwjy-cloud`.wms_raw_outstock x
where
(x.warehouse_id = 411
or x.warehouse_id = 412)
and DATE(x.apply_date) = curdate() group by x.warehouse_id
</select>
<select id="productOutInfo" resultType="com.hw.wms.domain.WmsProductInstock">
select
date_format(apply_date, '%Y-%m-%d 00:00:00') day,sum(outstock_qty) instock_amount
from
`hwjy-cloud`.wms_product_outstock
where
apply_date > now() - interval 7 day and warehouse_id = 431
group by
day
</select>
<select id="productFirstOutInfo" resultType="com.hw.wms.domain.WmsProductInstock">
select
date_format(apply_date, '%Y-%m-%d 00:00:00') day,sum(outstock_qty) instock_amount
from
`hwjy-cloud`.wms_product_outstock
where
apply_date > now() - interval 7 day and warehouse_id = 131
group by
day
</select>
<select id="dayRawInAmount" resultType="java.math.BigDecimal">
</select>
<select id="dayRawOutAmount" resultType="java.math.BigDecimal">
select
sum(real_outstock_amount) outStock
from
wms_raw_outstock
where
DATE_FORMAT( apply_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' ) and warehouse_id = 311
</select>
</mapper> </mapper>

Loading…
Cancel
Save