王杰 3 months ago
commit ccd746fa64

@ -0,0 +1,4 @@
package cn.estsh.i3plus.ext.mes.pcn.api.busi;
public interface IMesShippingKanbanCfgDetailService {
}

@ -0,0 +1,10 @@
package cn.estsh.i3plus.ext.mes.pcn.api.busi;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingKanbanCfgModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingKanbanModel;
public interface IMesShippingKanbanCfgService {
MesShippingKanbanCfgModel queryShippingKanbanCfg(String organizeCode);
void doSaveShippingKanbanCfg(MesShippingKanbanCfgModel request, String organizeCode, String username);
MesShippingKanbanModel queryShippingKanbanContext(String organizeCode);
}

@ -0,0 +1,67 @@
package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesShippingKanbanCfgService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingKanbanCfgModel;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.util.ResultBean;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
/**
* @Description: 线
* @Author: gsz
* @Date: 2024/5/25 18:16
* @Modify:
*/
@RestController
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesShippingKanbanCfg")
public class MesShippingKanbanCfgController {
@Autowired
private IMesShippingKanbanCfgService shippingKanbanCfgService;
@GetMapping("/query")
@ApiOperation(value = "查询发运看板配置项")
public ResultBean queryShippingKanbanCfg(String organizeCode) {
try {
organizeCode = !StringUtils.isEmpty(organizeCode) ? organizeCode : AuthUtil.getOrganize().getOrganizeCode();
return ResultBean.success("查询成功").setResultObject(shippingKanbanCfgService.queryShippingKanbanCfg(organizeCode));
} catch (ImppBusiException imppException) {
return ResultBean.fail(imppException);
} catch (Exception e) {
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
@PostMapping("/save")
@ApiOperation(value = "保存发运看板配置项")
public ResultBean saveShippingKanbanCfg(@RequestBody MesShippingKanbanCfgModel request) {
try {
String organizeCode = !StringUtils.isEmpty(request.getOrganizeCode()) ? request.getOrganizeCode() : AuthUtil.getOrganize().getOrganizeCode();
shippingKanbanCfgService.doSaveShippingKanbanCfg(request, organizeCode, request.getUsername());
return ResultBean.success("保存成功");
} catch (ImppBusiException imppException) {
return ResultBean.fail(imppException);
} catch (Exception e) {
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
@GetMapping("/queryContext")
@ApiOperation(value = "查询发运看板内容")
public ResultBean queryShippingKanbanContext(String organizeCode) {
try {
organizeCode = !StringUtils.isEmpty(organizeCode) ? organizeCode : AuthUtil.getOrganize().getOrganizeCode();
return ResultBean.success("查询成功").setResultObject(shippingKanbanCfgService.queryShippingKanbanContext(organizeCode));
} catch (ImppBusiException imppException) {
return ResultBean.fail(imppException);
} catch (Exception e) {
e.printStackTrace();
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
}

@ -0,0 +1,16 @@
package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi;
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Description: 线
* @Author: gsz
* @Date: 2024/5/25 18:16
* @Modify:
*/
@RestController
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesShippingKanbanCfgDetail")
public class MesShippingKanbanCfgDetailController {
}

@ -13,6 +13,7 @@ import cn.estsh.i3plus.pojo.mes.bean.MesPartShippingGroup;
import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrderPart; import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrderPart;
import cn.estsh.i3plus.pojo.mes.bean.shipping.MesShippingOrderManagement; import cn.estsh.i3plus.pojo.mes.bean.shipping.MesShippingOrderManagement;
import cn.estsh.i3plus.pojo.mes.bean.shipping.MesShippingOrderManagementDetail; import cn.estsh.i3plus.pojo.mes.bean.shipping.MesShippingOrderManagementDetail;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -81,6 +82,9 @@ public class MesJisShippingServiceImpl implements IMesJisShippingService {
MesConfig useCustOrderNo = configService.getMesConfigNoError(orderManagement.getOrganizeCode(), MesPcnExtConstWords.USE_CUST_ORDER_NO); MesConfig useCustOrderNo = configService.getMesConfigNoError(orderManagement.getOrganizeCode(), MesPcnExtConstWords.USE_CUST_ORDER_NO);
List<MesJisShipping> jisShippingList = new ArrayList<>(); List<MesJisShipping> jisShippingList = new ArrayList<>();
orderManagementDetailList.forEach(k -> { orderManagementDetailList.forEach(k -> {
if (k.getStatus() == MesExtEnumUtil.SHIPPING_ORDER_DETAIL_SHIPPING_STATUS.SKIP.getValue()) {
return;
}
MesJisShipping jisShipping = new MesJisShipping(); MesJisShipping jisShipping = new MesJisShipping();
BeanUtils.copyProperties(orderManagement, jisShipping, MesPcnExtConstWords.BASE_BEAN_FIELDS); BeanUtils.copyProperties(orderManagement, jisShipping, MesPcnExtConstWords.BASE_BEAN_FIELDS);
BeanUtils.copyProperties(k, jisShipping, MesPcnExtConstWords.BASE_BEAN_FIELDS); BeanUtils.copyProperties(k, jisShipping, MesPcnExtConstWords.BASE_BEAN_FIELDS);

@ -0,0 +1,8 @@
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesShippingKanbanCfgDetailService;
import org.springframework.stereotype.Service;
@Service
public class MesShippingKanbanCfgDetailServiceImpl implements IMesShippingKanbanCfgDetailService {
}

@ -0,0 +1,23 @@
package cn.estsh.i3plus.ext.mes.pcn.pojo.model;
import cn.estsh.i3plus.pojo.mes.bean.shipping.MesShippingKanbanCfg;
import cn.estsh.i3plus.pojo.mes.bean.shipping.MesShippingKanbanCfgDetail;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import java.util.List;
@Data
public class MesShippingKanbanCfgModel {
@ApiParam("组织代码")
private String organizeCode;
@ApiParam("用户名")
private String username;
@ApiParam("看板配置项")
private MesShippingKanbanCfg config;
@ApiParam("看板配置明细")
private List<MesShippingKanbanCfgDetail> details;
}

@ -0,0 +1,16 @@
package cn.estsh.i3plus.ext.mes.pcn.pojo.model;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class MesShippingKanbanModel {
@ApiParam("看板标题")
private String kanbanTitle;
@ApiParam("指标明细")
private List<MesShippingKanbanViewModel> details = new ArrayList<>();
}

@ -0,0 +1,26 @@
package cn.estsh.i3plus.ext.mes.pcn.pojo.model;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class MesShippingKanbanViewModel {
@ApiParam("名称")
private String detailName;
@ApiParam("排序")
private Integer orderNumber;
@ApiParam("计算值")
private List<String> values = new ArrayList<>();
@ApiParam("范围描述")
private String rangDescription;
@ApiParam("颜色")
private String color;
}
Loading…
Cancel
Save