admin
2024-05-11 c860ca1d4ceaa4065ac5f0257d7b4181880acedd
-接收工单
已修改5个文件
103 ■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/service/impl/DaPassingStationCollectionServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/domain/OmProductionOrdeInfo.java 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/om/productionOrde/OmProductionOrdeInfoMapper.xml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/om/productionOrde/index.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/service/impl/DaPassingStationCollectionServiceImpl.java
@@ -153,7 +153,7 @@
    public int jrmAddPassingStationCollection(DaPassingStationCollection daPassingStationCollection) {
        for (String model : daPassingStationCollection.getSfcCode().split(",")) {
            daPassingStationCollection.setSfcCode(model);
            boolean save = daPassingStationCollectionService.save(daPassingStationCollection);
            daPassingStationCollectionService.save(daPassingStationCollection);
        }
        return 1;
    }
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java
@@ -5,13 +5,18 @@
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jcdm.common.core.domain.entity.SysUser;
import com.jcdm.common.core.domain.model.LoginUser;
import com.jcdm.common.utils.ServletUtils;
import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo;
import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfoExcelImport;
import com.jcdm.main.om.productionOrde.mapper.OmProductionOrdeInfoMapper;
import com.jcdm.main.om.productionOrde.service.IOmProductionOrdeInfoService;
import com.jcdm.main.restful.factoryMes.service.RestfulService;
import org.aspectj.weaver.loadtime.Aj;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -69,6 +74,38 @@
        util.exportExcel(response, list, "生产工单数据");
    }
    @GetMapping("/receivingWorkOrders")
    public AjaxResult receivingWorkOrders()
    {
        String paramProductNum = "";
        // 查询最新的工单信息
        List<OmProductionOrdeInfo> list = omProductionOrdeInfoService.list(new LambdaQueryWrapper<OmProductionOrdeInfo>().orderByAsc(OmProductionOrdeInfo::getCreateTime));
        if(list.size() > 0){
            paramProductNum = list.get(list.size()-1).getProductNum();
        }
        String orderJsonString = RestfulService.getProductionWorkOrderRequest(paramProductNum, "POP230");
        JSONObject jsonObject = new JSONObject(orderJsonString);
        // 从JSONObject中获取data对象
        JSONObject dataObject = jsonObject.getJSONObject("data");
        String code = jsonObject.getStr("code");
        // 判断接单是否成功
        if(code.equals("success")){
            OmProductionOrdeInfo omProductionOrdeInfo = new OmProductionOrdeInfo();
            omProductionOrdeInfo.setWorkOrderNo(dataObject.getStr("productionOrderNum"));
            omProductionOrdeInfo.setProductNum(dataObject.getStr("productNum"));
            omProductionOrdeInfo.setStationCode(dataObject.getStr("stationCode"));
            omProductionOrdeInfo.setMaterialCode(dataObject.getStr("materialCode"));
            omProductionOrdeInfo.setCreateTime(new Date());
            omProductionOrdeInfo.setCreateUser("工厂MES");
            omProductionOrdeInfoService.save(omProductionOrdeInfo);
        }else {
            return AjaxResult.error("接单失败,请联系管理员");
        }
        return AjaxResult.success(dataObject.getStr("productNum"));
    }
    /**
     * 获取生产工单详细信息
     */
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/domain/OmProductionOrdeInfo.java
@@ -142,6 +142,10 @@
    @Excel(name = "工单状态", readConverterExp = "1=创建、2已发布、3生产中、4已冻结、5已完工、6已关闭")
    private String orderStatus;
    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /** 创建人 */
    @Excel(name = "创建人")
    private String createUser;
@@ -164,7 +168,7 @@
    /** 市场区域编码 */
    @Excel(name = "市场区域编码")
    private String marketAreaCode;
    private String materialCode;
    /** 软件版本编码 */
    @Excel(name = "软件版本编码")
@@ -191,6 +195,17 @@
    @TableField(exist = false)
    private String flag;
    @Override
    public Date getCreateTime() {
        return createTime;
    }
    @Override
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getProductModel() {
        return productModel;
@@ -526,16 +541,16 @@
    {
        return custom;
    }
    public void setMarketAreaCode(String marketAreaCode)
    {
        this.marketAreaCode = marketAreaCode;
    public String getMaterialCode() {
        return materialCode;
    }
    public String getMarketAreaCode()
    {
        return marketAreaCode;
    public void setMaterialCode(String materialCode) {
        this.materialCode = materialCode;
    }
    public void setSoftwareVersionCode(String softwareVersionCode)
    public void setSoftwareVersionCode(String softwareVersionCode)
    {
        this.softwareVersionCode = softwareVersionCode;
    }
@@ -624,7 +639,6 @@
            .append("remarks", getRemarks())
            .append("streamNumber", getStreamNumber())
            .append("custom", getCustom())
            .append("marketAreaCode", getMarketAreaCode())
            .append("softwareVersionCode", getSoftwareVersionCode())
            .append("productCompanyCode", getProductCompanyCode())
            .append("spareField2", getSpareField2())
jcdm-main/src/main/resources/mapper/om/productionOrde/OmProductionOrdeInfoMapper.xml
@@ -36,7 +36,7 @@
        <result property="remarks"    column="remarks"    />
        <result property="streamNumber"    column="stream_number"    />
        <result property="custom"    column="custom"    />
        <result property="marketAreaCode"    column="market_area_code"    />
        <result property="materialCode"    column="material_code"    />
        <result property="softwareVersionCode"    column="software_version_code"    />
        <result property="productCompanyCode"    column="product_company_code"    />
        <result property="trolleyYard"    column="trolley_yard"    />
@@ -54,7 +54,7 @@
    </resultMap>
    <sql id="selectOmProductionOrdeInfoVo">
        select id,site_code,product_num,station_code, product_model,result_code,result_text,sf_result ,work_order_no, sales_order_code, product_code, product_name, workshop_code, line_code, route_code, bom_code, recipe_code, plan_qty, actual_qty, bad_qty, scrap_qty, repair_qty, actual_online_qty, online_completion_mark, demand_date, plan_start_time, plan_end_time, actual_start_time, actual_end_time, serial_number, order_status, create_time, update_time, create_user, update_user, remarks, stream_number, custom, market_area_code, software_version_code, product_company_code, trolley_yard, spare_field2, spare_field3, spare_field4 from om_production_orde_info
        select id,site_code,product_num,station_code, product_model,result_code,result_text,sf_result ,work_order_no, sales_order_code, product_code, product_name, workshop_code, line_code, route_code, bom_code, recipe_code, plan_qty, actual_qty, bad_qty, scrap_qty, repair_qty, actual_online_qty, online_completion_mark, demand_date, plan_start_time, plan_end_time, actual_start_time, actual_end_time, serial_number, order_status, create_time, update_time, create_user, update_user, remarks, stream_number, custom, material_code, software_version_code, product_company_code, trolley_yard, spare_field2, spare_field3, spare_field4 from om_production_orde_info
    </sql>
    <select id="selectOmProductionOrdeInfoList" parameterType="OmProductionOrdeInfo" resultMap="OmProductionOrdeInfoResult">
@@ -72,7 +72,7 @@
            <if test="recipeCode != null  and recipeCode != ''"> and recipe_code like concat('%', #{recipeCode}, '%')</if>
            <if test="orderStatus != null  and orderStatus != ''"> and order_status = #{orderStatus}</if>
            <if test="custom != null  and custom != ''"> and custom like concat('%', #{custom}, '%')</if>
            <if test="marketAreaCode != null  and marketAreaCode != ''"> and market_area_code like concat('%', #{marketAreaCode}, '%')</if>
            <if test="materialCode != null  and materialCode != ''"> and material_code like concat('%', #{materialCode}, '%')</if>
            <if test="softwareVersionCode != null  and softwareVersionCode != ''"> and software_version_code like concat('%', #{softwareVersionCode}, '%')</if>
            <if test="productCompanyCode != null  and productCompanyCode != ''"> and product_company_code like concat('%', #{productCompanyCode}, '%')</if>
            <if test="siteCode != null  and siteCode != ''"> and site_code = #{siteCode}</if>
@@ -124,7 +124,7 @@
            <if test="remarks != null">remarks,</if>
            <if test="streamNumber != null">stream_number,</if>
            <if test="custom != null">custom,</if>
            <if test="marketAreaCode != null">market_area_code,</if>
            <if test="materialCode != null">material_code,</if>
            <if test="softwareVersionCode != null">software_version_code,</if>
            <if test="productCompanyCode != null">product_company_code,</if>
            <if test="trolleyYard != null">trolley_yard,</if>
@@ -172,7 +172,7 @@
            <if test="remarks != null">#{remarks},</if>
            <if test="streamNumber != null">#{streamNumber},</if>
            <if test="custom != null">#{custom},</if>
            <if test="marketAreaCode != null">#{marketAreaCode},</if>
            <if test="materialCode != null">#{materialCode},</if>
            <if test="softwareVersionCode != null">#{softwareVersionCode},</if>
            <if test="productCompanyCode != null">#{productCompanyCode},</if>
            <if test="trolleyYard != null">#{trolleyYard},</if>
@@ -223,7 +223,7 @@
            <if test="remarks != null">remarks = #{remarks},</if>
            <if test="streamNumber != null">stream_number = #{streamNumber},</if>
            <if test="custom != null">custom = #{custom},</if>
            <if test="marketAreaCode != null">market_area_code = #{marketAreaCode},</if>
            <if test="materialCode != null">material_code = #{materialCode},</if>
            <if test="softwareVersionCode != null">software_version_code = #{softwareVersionCode},</if>
            <if test="productCompanyCode != null">product_company_code = #{productCompanyCode},</if>
            <if test="trolleyYard != null">trolley_yard = #{trolleyYard},</if>
jcdm-ui/src/views/main/om/productionOrde/index.vue
@@ -126,7 +126,7 @@
          plain
          icon="el-icon-download"
          size="mini"
          @click="receivingWorkOrders"
          @click="getWorkOrders"
        >接收</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -273,7 +273,16 @@
import { listProductBom } from "@/api/main/bs/ProductBom/ProductBom";
import { listTechnologyRoute} from "@/api/main/bs/technologyRoute/technologyRoute";
import ItemSelect  from "@/components/itemSelect/single.vue";
import { importTemplate, upDownMove, listProductionOrde, getProductionOrde, delProductionOrde, addProductionOrde, updateProductionOrde } from "@/api/main/om/productionOrde/productionOrde";
import {
  importTemplate,
  upDownMove,
  listProductionOrde,
  getProductionOrde,
  delProductionOrde,
  addProductionOrde,
  updateProductionOrde,
  receivingWorkOrders
} from "@/api/main/om/productionOrde/productionOrde";
export default {
  name: "ProductionOrde",
@@ -375,8 +384,11 @@
    this.initWorkshop();
  },
  methods: {
    receivingWorkOrders(){
    getWorkOrders(){
      receivingWorkOrders().then(response => {
        this.$modal.msgSuccess(response.msg);
        this.getList()
      });
    },
    /** 导入按钮操作 */
    handleImport() {