MES:
-生产派工上传图纸和SOP格式和文件大小可配置
-生产派工完善,计划开始时间和计划结束时间不能编辑的bug修复
-物料信息:增加状态的修改,其他选择物料的页面需要根据状态过滤
FILE
文件大小和允许格式改为nacos中配置文件配置
master
xs 5 months ago
parent c82747aded
commit acc82ef812

@ -39,6 +39,16 @@ public interface RemoteMesService {
@PostMapping("/materialinfo/getMaterialsByMaterialIds")
public R<List<MesBaseMaterialInfo>> getMaterialsByMaterialIds(@RequestBody MesBaseMaterialInfoVo mesBaseMaterialInfo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
* ID
*
* @param materialId
* @param source
* @return
*/
@PostMapping("/materialinfo/getMaterialByMaterialId")
public R<MesBaseMaterialInfo> getMaterialByMaterialId(@PathVariable("materialId") Long materialId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
*

@ -121,6 +121,9 @@ public class MesBaseMaterialInfo extends BaseEntity
/**安全库存数量*/
private BigDecimal safeStockAmount;
/**申请标识(1是0否),代表是否需要申请才能出库*/
private String applyFlag;
/** erp最后更新日期;对应FModifyDate */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "erp最后更新日期;对应FModifyDate", width = 30, dateFormat = "yyyy-MM-dd")
@ -374,6 +377,14 @@ public class MesBaseMaterialInfo extends BaseEntity
this.safeStockAmount = safeStockAmount;
}
public String getApplyFlag() {
return applyFlag;
}
public void setApplyFlag(String applyFlag) {
this.applyFlag = applyFlag;
}
public void setErpModifyDate(Date erpModifyDate)
{
this.erpModifyDate = erpModifyDate;

@ -35,6 +35,11 @@ public class RemoteMesFallbackFactory implements FallbackFactory<RemoteMesServic
@Override
public R<List<MesBaseMaterialInfo>> getMaterialsByMaterialIds(MesBaseMaterialInfoVo mesBaseMaterialInfo, String source) {
return R.fail("获取物料信息列表失败:" + throwable.getMessage());
}
@Override
public R<MesBaseMaterialInfo> getMaterialByMaterialId(Long materialId, String source) {
return R.fail("获取物料信息失败:" + throwable.getMessage());
}

@ -199,4 +199,16 @@ public class MesConstants {
* (10)*/
public static final String MES_PROCESS_DISPLAY_FLAG_YES = "1";//是
/**
*
*/
public static final String MES_MATERIAL_APPLY_FLAG_YES = "1";//是
public static final String MES_MATERIAL_APPLY_FLAG_NO = "0";//否
/**
*
*/
public static final String MES_MATERIAL_ACTIVE_FLAG_NORMAL = "1";//正常
public static final String MES_MATERIAL_ACTIVE_FLAG_STOP = "0";//停用
}

@ -101,7 +101,7 @@ public enum SyncMaterialInfoEnums {
public static void main(String[] args) {
System.out.println(fieldKeyList.toString().replaceAll("\\[","").replaceAll("]",""));
// System.out.println(fieldKeyList.toString().replaceAll("\\[","").replaceAll("]",""));
for (SyncMaterialInfoEnums syncMaterialInfoEnums : SyncMaterialInfoEnums.values()) {
// System.out.println(syncMaterialInfoEnums + " - " + syncMaterialInfoEnums.getDataType());
}

@ -303,7 +303,7 @@ public class KingdeeErpService {
requestParams.put("Id", params.get("Id"));//单据内码集合
//调用接口
String audit = client.view(formId, requestParams.toJSONString());
System.out.println(("genericAuditInterface|formId" + formId + "|请求参数:" + requestParams.toJSONString() + "|返回结果:" + audit));
// System.out.println(("genericAuditInterface|formId" + formId + "|请求参数:" + requestParams.toJSONString() + "|返回结果:" + audit));
return audit;
}
@ -364,7 +364,7 @@ public class KingdeeErpService {
public String testAssemblyEntity(String params) {
JSONObject model = new JSONObject();
String result = this.saveGenericAssemblyEntity(model);
System.out.println(result);
// System.out.println(result);
return result;
}
@ -382,7 +382,7 @@ public class KingdeeErpService {
}
//调用接口
String save = client.save(formId, params.toJSONString());
System.out.println(("genericSaveInterface|formId" + formId + "|请求参数:" + params.toJSONString() + "|返回结果:" + save));
// System.out.println(("genericSaveInterface|formId" + formId + "|请求参数:" + params.toJSONString() + "|返回结果:" + save));
return save;
}

@ -2,6 +2,7 @@ package com.hw.jindie.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils;
import com.hw.jindie.api.domain.vo.ErpSyncInfoVo;
@ -82,7 +83,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
String filterString = "FModifyDate >'" + maxErpModifyDate + "'";
queryJson.put("FilterString", filterString);
}
System.out.println(queryJson.toString());
// System.out.println(queryJson.toString());
String result = api.billQuery(queryJson.toString());
if (StringUtils.isEmpty(result)) {
@ -151,7 +152,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
}
System.out.println("size:" + resultArray.size());
System.out.println(resultArray);
// System.out.println(resultArray);
//如果返回的数组的数量等于分页数量,则继续获取下一页数据
if (resultArray.size() == limit) {
//通过递归同步所有供应商,测试先不用
@ -420,6 +421,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
mesBaseMaterialInfo.setMaterialId(existedMesBaseMaterialInfo.getMaterialId());
toUpdateMaterialInfoList.add(mesBaseMaterialInfo);
} else {
mesBaseMaterialInfo.setActiveFlag(MesConstants.MES_MATERIAL_ACTIVE_FLAG_NORMAL);
toInsertMaterialInfoList.add(mesBaseMaterialInfo);
}
}

@ -3,8 +3,10 @@ package com.hw.mes.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.hw.common.core.constant.Constants;
import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.domain.R;
import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.StringUtils;
import com.hw.common.core.utils.uuid.UUID;
import com.hw.system.api.RemoteFileService;
@ -118,8 +120,11 @@ public class MesBaseAttachInfoController extends BaseController {
} else {
fileResult = remoteFileService.upload(file);
}
if (fileResult.getCode() == Constants.FAIL) {
throw new ServiceException(fileResult.getMsg());
}
} catch (Exception e) {
return error("文件服务异常,请联系管理员");
return error("文件服务异常,请联系管理员" + e.getMessage());
}
String url = fileResult.getData().getUrl();
String name = fileResult.getData().getName();

@ -133,4 +133,15 @@ public class MesBaseMaterialInfoController extends BaseController
}
/**
*
*/
@InnerAuth
@GetMapping(value = "/getMaterialByMaterialId/materialId}")
public AjaxResult getMaterialByMaterialId(@PathVariable("materialId") Long materialId)
{
return success(mesBaseMaterialInfoService.selectMesBaseMaterialInfoByMaterialId(materialId));
}
}

@ -42,7 +42,7 @@ public class MesMaterialBomController extends BaseController
@GetMapping("/list")
public AjaxResult list(MesMaterialBom mesMaterialBom)
{
List<MesMaterialBom> list = mesMaterialBomService.selectMesMaterialBomList(mesMaterialBom);
List<MesMaterialBom> list = mesMaterialBomService.selectMesMaterialBomJoinList(mesMaterialBom);
return success(list);
}

@ -120,23 +120,23 @@ public class MesProductPlan extends BaseEntity
private BigDecimal completeAmount;
/** 计划开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划开始时间", width = 30, dateFormat = "yyyy-MM-dd")
@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")
@Excel(name = "计划结束时间", width = 30, dateFormat = "yyyy-MM-dd")
@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")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
@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")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date realEndTime;
/** 附件信息,关联附件信息主键;多个用,隔开;页面可选择附件信息,也可直接上传 */

@ -22,7 +22,7 @@ public class MesProductPlanEditVo {
private Long productOrderId;
//此次生产派工数量
private BigDecimal dispatchAmount;
private int dispatchAmount;
//保存的生产计划
@NotNull(message = "没有修改的生产派工提交")

@ -12,6 +12,7 @@ import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.domain.MesOrderBind;
import com.hw.mes.mapper.MesBaseBarcodeInfoMapper;
import com.hw.mes.mapper.MesOrderBindMapper;
import org.apache.poi.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesBaseMaterialInfoMapper;
@ -55,7 +56,7 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
@Override
public List<MesBaseMaterialInfo> selectMesBaseMaterialInfoList(MesBaseMaterialInfo mesBaseMaterialInfo) {
mesBaseMaterialInfo.setMaterialSpec(StringUtils.isNotEmpty(mesBaseMaterialInfo.getMaterialSpec())
? mesBaseMaterialInfo.getMaterialSpec().replaceAll("\\s+", ""):"");
? mesBaseMaterialInfo.getMaterialSpec().replaceAll("\\s+", "") : "");
return mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoList(mesBaseMaterialInfo);
}
@ -96,7 +97,8 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
mesBaseMaterialInfo.setUpdateTime(DateUtils.getNowDate());
mesBaseMaterialInfo.setUpdateBy(SecurityUtils.getUsername());
if (!mesBaseMaterialInfo.getBatchFlag().equals(MesConstants.IS_BATCH)) {
if (StringUtils.isNotEmpty(mesBaseMaterialInfo.getBatchFlag())
&& !mesBaseMaterialInfo.getBatchFlag().equals(MesConstants.IS_BATCH)) {
mesBaseMaterialInfo.setBatchAmount(BigDecimal.ONE);
}
return mesBaseMaterialInfoMapper.updateMesBaseMaterialInfo(mesBaseMaterialInfo);

@ -119,6 +119,8 @@ public class MesMaterialBomServiceImpl implements IMesMaterialBomService
@Override
public List<MesMaterialBom> selectMesMaterialBomJoinList(MesMaterialBom mesMaterialBom)
{
mesMaterialBom.setMaterialSpec(StringUtils.isNotEmpty(mesMaterialBom.getMaterialSpec())
? mesMaterialBom.getMaterialSpec().replaceAll("\\s+", "") : "");
return mesMaterialBomMapper.selectMesMaterialBomJoinList(mesMaterialBom);
}

@ -153,16 +153,16 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
* @param mesProductOrder
*/
private void checkSameProcessTimeClash(MesProductOrder mesProductOrder) {
HashMap<String, Object> map = new HashMap<>();
map.put("planBeginTime", DateUtils.parseDateToStr(YYYY_MM_DD_HH_MM_SS, mesProductOrder.getPlanBeginTime()));
map.put("planEndTime", DateUtils.parseDateToStr(YYYY_MM_DD_HH_MM_SS, mesProductOrder.getPlanEndTime()));
MesProductOrder productOrder = new MesProductOrder();
productOrder.setParams(map);
productOrder.setDispatchId(mesProductOrder.getDispatchId());
List<MesProductOrder> productOrderList = mesProductOrderMapper.selectMesProductOrderList(productOrder);
if (productOrderList.size() > 0) {
throw new ServiceException("此工艺路线的生产工单时间冲突");
}
// HashMap<String, Object> map = new HashMap<>();
// map.put("planBeginTime", DateUtils.parseDateToStr(YYYY_MM_DD_HH_MM_SS, mesProductOrder.getPlanBeginTime()));
// map.put("planEndTime", DateUtils.parseDateToStr(YYYY_MM_DD_HH_MM_SS, mesProductOrder.getPlanEndTime()));
// MesProductOrder productOrder = new MesProductOrder();
// productOrder.setParams(map);
// productOrder.setDispatchId(mesProductOrder.getDispatchId());
// List<MesProductOrder> productOrderList = mesProductOrderMapper.selectMesProductOrderList(productOrder);
// if (productOrderList.size() > 0) {
// throw new ServiceException("此工艺路线的生产工单时间冲突");
// }
}
/**

@ -285,7 +285,7 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
BigDecimal dispatchedAmount = mesProductOrder.getDispatchAmount() == null ? BigDecimal.ZERO : mesProductOrder.getDispatchAmount();
BigDecimal planAmount = mesProductOrder.getPlanAmount();
BigDecimal updateDispatchAmount = dispatchedAmount.add(mesProductPlanEditVo.getDispatchAmount());
BigDecimal updateDispatchAmount = dispatchedAmount.add(new BigDecimal(mesProductPlanEditVo.getDispatchAmount()));
if (updateDispatchAmount.compareTo(planAmount) > 0) {
throw new ServiceException("总派工数量不能大于计划数量,请重新派工");
}

@ -37,6 +37,7 @@
<result property="approveDate" column="approve_date"/>
<result property="erpModifyDate" column="erp_modify_date"/>
<result property="safeStockAmount" column="safe_stock_amount"/>
<result property="applyFlag" column="apply_flag"/>
<result property="warehouseId" column="warehouse_id"/>
<result property="purchasePriceUnitId" column="purchase_price_unit_id"/>
</resultMap>
@ -67,6 +68,7 @@
bmi.prodline_id,
bmi.active_flag,
bmi.deleted_flag,
bmi.apply_flag,
bmi.remark,
bmi.create_by,
bmi.create_time,

@ -153,21 +153,44 @@
<select id="selectMesMaterialBomJoinList" parameterType="MesMaterialBom" resultMap="MesMaterialBomResult">
select mmb.material_id,mbmi.material_code,mbmi.material_name,mbmi.material_spec,mmb.standard_amount
select mmb.material_bom_id,
mmb.parent_id,
mmb.ancestors,
mmb.material_id,
mmb.material_bom_desc,
mmb.standard_amount,
mmb.top_flag,
mmb.check_type,
mmb.project_id,
mmb.active_flag,
mmb.remark,
mmb.create_by,
mmb.create_time,
mmb.update_by,
mmb.update_time,
mmb.assemble_time,
mbmi.material_code,mbmi.material_name,mbmi.material_spec
from mes_material_bom mmb left join mes_base_material_info mbmi on mmb.material_id=mbmi.material_id
<where>
<if test="parentId != null ">and mmb.parent_id = #{parentId}</if>
<if test="ancestors != null and ancestors != ''">and mmb.ancestors like concat(#{ancestors}, '%')</if>
<if test="materialId != null ">and mmb.material_id = #{materialId}</if>
<if test="materialCode != null and materialCode != ''">and mbmi.material_code like concat('%',
#{materialCode}, '%')
</if>
<if test="materialName != null and materialName != ''">and mbmi.material_name like concat('%',
#{materialName}, '%')
</if>
<if test="materialSpec != null and materialSpec != ''">and replace(mbmi.material_spec,' ','') like concat('%', #{materialSpec},
'%')</if>
<if test="standardAmount != null ">and mmb.standard_amount = #{standardAmount}</if>
<if test="topFlag != null ">and mmb.top_flag = #{topFlag}</if>
<if test="checkType != null and checkType != ''">and mmb.check_type = #{checkType}</if>
<if test="projectId != null ">and mmb.project_id = #{projectId}</if>
<if test="activeFlag != null and activeFlag != ''">and mmb.active_flag = #{activeFlag}</if>
</where>
order by mmb.material_bom_id desc
</select>

@ -309,11 +309,11 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (baseBarcodeInfoR == null) {
throw new ServiceException("物料码有误");
throw new ServiceException("物料码有误");
}
MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData();
if (baseBarcodeInfo == null) {
throw new ServiceException("物料码有误");
throw new ServiceException("物料码有误");
}
String batchFlag = baseBarcodeInfo.getBatchFlag();
@ -333,23 +333,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
if (rawOutstockId != null) {
wmsRawOutstock = wmsRawOutstockMapper.selectWmsRawOutstockByRawOutstockId(rawOutstockId);
} else {
WmsRawOutstock queryRawOutstock = new WmsRawOutstock();
queryRawOutstock.setWarehouseId(baseLocation.getWarehouseId());
queryRawOutstock.setMaterialId(baseBarcodeInfo.getMaterialId());
queryRawOutstock.setExecuteStatusStr(WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE + "," + WmsConstants.WMS_EXECUTE_STATUS_EXECUTING);
queryRawOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS);
queryRawOutstock.setRawOutstockId(rawOutstockId);
List<WmsRawOutstock> wmsRawOutstocks = wmsRawOutstockMapper.selectWmsRawOutstockList(queryRawOutstock);
if (wmsRawOutstocks == null || wmsRawOutstocks.isEmpty()) {
throw new ServiceException("无此出库任务");
}
if (wmsRawOutstocks.size() > 1) {
throw new ServiceException("请选择具体出库任务后点击确认");
}
wmsRawOutstock = wmsRawOutstocks.get(0);
wmsRawOutstock = this.getWmsRawOutstock(baseLocation,baseBarcodeInfo);
}
@ -403,6 +387,28 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
return 1;
}
public WmsRawOutstock getWmsRawOutstock(WmsBaseLocation baseLocation,MesBaseBarcodeInfo baseBarcodeInfo){
WmsRawOutstock queryRawOutstock = new WmsRawOutstock();
queryRawOutstock.setWarehouseId(baseLocation.getWarehouseId());
queryRawOutstock.setMaterialId(baseBarcodeInfo.getMaterialId());
queryRawOutstock.setExecuteStatusStr(WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE + "," + WmsConstants.WMS_EXECUTE_STATUS_EXECUTING);
queryRawOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS);
List<WmsRawOutstock> wmsRawOutstocks = wmsRawOutstockMapper.selectWmsRawOutstockList(queryRawOutstock);
if (wmsRawOutstocks == null || wmsRawOutstocks.isEmpty()) {
throw new ServiceException("无此出库任务");
}
if (wmsRawOutstocks.size() > 1) {
throw new ServiceException("请选择具体出库任务后点击确认");
}
WmsRawOutstock wmsRawOutstock = wmsRawOutstocks.get(0);
return wmsRawOutstock;
}
public void insertRawOutstockDetail(WmsRawOutstock wmsRawOutstock, String locationCode, String materialBarcode, String batchCode,
String userName, Date currentDate) {
WmsRawOutstockDetail wmsRawOutstockDetail = new WmsRawOutstockDetail();

Loading…
Cancel
Save