Merge remote-tracking branch 'origin/dev' into dev
| | |
| | | { |
| | | return toAjax(apsBomHeaderService.deleteApsBomHeaderByIds(ids)); |
| | | } |
| | | |
| | | @PostMapping("/test") |
| | | public void test() |
| | | { |
| | | apsBomHeaderService.setBomDataToRedis("FORTUNA"); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.controller.mainPlan; |
| | | |
| | | import com.aps.common.core.web.controller.BaseController; |
| | | import com.aps.common.core.web.page.TableDataInfo; |
| | | import com.aps.common.security.annotation.RequiresPermissions; |
| | | import com.aps.core.domain.ApsPlateOrderPlanManager; |
| | | import com.aps.core.service.IApsPlateOrderPlanManagerService; |
| | | 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; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * é£éå·¥å计å管çLineController |
| | | * |
| | | * @author sfd |
| | | * @date 2025-05-08 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/ApsPlatOrderPlanManager") |
| | | public class ApsPlatOrderPlanManagerController extends BaseController |
| | | { |
| | | @Autowired |
| | | private IApsPlateOrderPlanManagerService iapPlateOrderPlanManagerService; |
| | | |
| | | /** |
| | | * æ¥è¯¢é£éå·¥å计å |
| | | */ |
| | | @RequiresPermissions("ApsPlatOrderPlanManager:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ApsPlateOrderPlanManager apsPlateOrderPlanManager) |
| | | { |
| | | startPage(); |
| | | List<ApsPlateOrderPlanManager> list = iapPlateOrderPlanManagerService.selectApsPlanOrderManager(apsPlateOrderPlanManager); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.domain; |
| | | |
| | | import com.aps.common.core.annotation.Excel; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serial; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * æ åå·¥èºè·¯çº¿Header对象 aps_standard_process_route_header |
| | | * |
| | | * @author zhl |
| | | * @date 2025-05-06 |
| | | */ |
| | | @Data |
| | | public class ApsPlateOrderPlanManager |
| | | { |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** éæ±ID */ |
| | | @Excel(name = "éæ±ID") |
| | | private String requireId; |
| | | |
| | | /** éæ±è¿½æº¯ID */ |
| | | @Excel(name = "éæ±è¿½æº¯ID") |
| | | private String requireTraceId; |
| | | |
| | | /** å·¥åå· */ |
| | | @Excel(name = "å·¥åå·") |
| | | private String workOrderNo; |
| | | |
| | | /** å¹é
æ°é */ |
| | | @Excel(name = "å¹é
æ°é") |
| | | private BigDecimal deductionAmount; |
| | | |
| | | /** å·¥åç±»å */ |
| | | @Excel(name = "å·¥åç±»å") |
| | | private String workOrderType; |
| | | |
| | | /** æå· */ |
| | | @Excel(name = "æå·") |
| | | private String mainPartNumber; |
| | | |
| | | /** 主件å¾å· */ |
| | | @Excel(name = "主件å¾å·") |
| | | private String mainPartDrawingNumber; |
| | | |
| | | /** ä¸»ä»¶å®¢æ· */ |
| | | @Excel(name = "主件客æ·") |
| | | private String customer; |
| | | |
| | | /** ç产æ°é */ |
| | | @Excel(name = "ç产æ°é") |
| | | private BigDecimal productionQuantity; |
| | | |
| | | /** éç¨å·¥å */ |
| | | @Excel(name = "éç¨å·¥å") |
| | | private String applicableFactories; |
| | | |
| | | /** å»¶è¿é£é©æ è¯ */ |
| | | @Excel(name = "å»¶è¿é£é©æ è¯") |
| | | private String hasDelayRisk; |
| | | |
| | | /** ç产åºå° */ |
| | | @Excel(name = "ç产åºå°") |
| | | private String productionBase; |
| | | |
| | | /** 计åå¼å·¥æ¥ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "计åå¼å·¥æ¥", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date planStartDay; |
| | | |
| | | /** 计åå®å·¥æ¥ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "计åå®å·¥æ¥", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date planEndDay; |
| | | |
| | | /** æªå¹é
çç产æ°é*/ |
| | | private BigDecimal unmatchedQuantity; |
| | | |
| | | /** å·¥åå建æ¶é´ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "å·¥åå建æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date orderCreateTime; |
| | | } |
| | |
| | | package com.aps.core.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.aps.core.domain.ApsBomHeader; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * BOM Header æ°æ®ç®¡çMapperæ¥å£ |
| | |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsBomHeaderByIds(Long[] ids); |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢BOMæ°æ® ç¨äºåå¨å°redisä¸ |
| | | * |
| | | * @param orgCode BOM Header æ°æ®ç®¡ç |
| | | * @return BOM Header æ°æ®ç®¡çéå |
| | | */ |
| | | List<JSONObject> selectBomRedisData(String orgCode); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.mapper; |
| | | |
| | | import com.aps.core.domain.ApsPlateOrderPlanManager; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * é£éå·¥å计åç®¡çæ¥å£ |
| | | * |
| | | * @author sfd |
| | | * @date 2025-05-08 |
| | | */ |
| | | @Mapper |
| | | public interface ApsPlateOrderPlanManagerMapper |
| | | { |
| | | |
| | | /** |
| | | * é£éå·¥å计å管ç |
| | | * |
| | | * @param apsPlateOrderPlanManager é£éå·¥å计å管ç |
| | | * @return é£éå·¥å计å管ç |
| | | */ |
| | | List<ApsPlateOrderPlanManager> selectApsPlanOrderManager(ApsPlateOrderPlanManager apsPlateOrderPlanManager); |
| | | } |
| | |
| | | package com.aps.core.service; |
| | | |
| | | import java.util.List; |
| | | import com.aps.core.domain.ApsBomHeader; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * BOM Header æ°æ®ç®¡çServiceæ¥å£ |
| | |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsBomHeaderById(Long id); |
| | | |
| | | |
| | | /** |
| | | * 忥BOMæ°æ®å°Redis |
| | | * @return |
| | | */ |
| | | public boolean setBomDataToRedis(String orgCode); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.service; |
| | | |
| | | import com.aps.core.domain.ApsPlateOrderPlanManager; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * é£éå·¥å计å管çServiceæ¥å£ |
| | | * |
| | | * @author sfd |
| | | * @date 2025-05-08 |
| | | */ |
| | | public interface IApsPlateOrderPlanManagerService |
| | | { |
| | | |
| | | List<ApsPlateOrderPlanManager> selectApsPlanOrderManager(ApsPlateOrderPlanManager apsPlateOrderPlanManager); |
| | | } |
| | |
| | | package com.aps.core.service.impl; |
| | | |
| | | import java.util.List; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.aps.common.core.utils.DateUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.aps.core.mapper.ApsBomHeaderMapper; |
| | | import com.aps.core.domain.ApsBomHeader; |
| | | import com.aps.core.mapper.ApsBomHeaderMapper; |
| | | import com.aps.core.service.IApsBomHeaderService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * BOM Header æ°æ®ç®¡çServiceä¸å¡å±å¤ç |
| | |
| | | { |
| | | @Autowired |
| | | private ApsBomHeaderMapper apsBomHeaderMapper; |
| | | |
| | | @Autowired |
| | | public RedisTemplate redisTemplate; |
| | | |
| | | /** |
| | | * æ¥è¯¢BOM Header æ°æ®ç®¡ç |
| | |
| | | { |
| | | return apsBomHeaderMapper.deleteApsBomHeaderById(id); |
| | | } |
| | | |
| | | /** |
| | | * 设置BOMæ°æ®å°Redis |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean setBomDataToRedis(String orgCode) { |
| | | try { |
| | | List<JSONObject> bomRedisData = apsBomHeaderMapper.selectBomRedisData(orgCode); |
| | | String nowMainItemCode = ""; |
| | | JSONArray bomLine = new JSONArray(); |
| | | for (int i=0,size=bomRedisData.size();i<size;i++) { |
| | | JSONObject jsonObject = bomRedisData.get(i); |
| | | if("".equals(nowMainItemCode)){ |
| | | nowMainItemCode = jsonObject.getString("mainitemcode"); |
| | | } |
| | | if(!nowMainItemCode.equals(jsonObject.getString("mainitemcode"))){ |
| | | redisTemplate.opsForValue().set("BOM:BOM_"+orgCode+"_"+nowMainItemCode, bomLine); |
| | | bomLine = new JSONArray(); |
| | | } |
| | | bomLine.add(jsonObject); |
| | | nowMainItemCode = jsonObject.getString("mainitemcode"); |
| | | if(i==size-1){ |
| | | redisTemplate.opsForValue().set("BOM:BOM_"+orgCode+"_"+nowMainItemCode, bomLine); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.service.impl; |
| | | |
| | | import com.aps.common.core.utils.DateUtils; |
| | | import com.aps.common.core.utils.uuid.IdUtils; |
| | | import com.aps.common.security.utils.SecurityUtils; |
| | | import com.aps.core.domain.ApsPlant; |
| | | import com.aps.core.domain.ApsPlateOrderPlanManager; |
| | | import com.aps.core.mapper.ApsPlantMapper; |
| | | import com.aps.core.mapper.ApsPlateOrderPlanManagerMapper; |
| | | import com.aps.core.service.IApsPlantService; |
| | | import com.aps.core.service.IApsPlateOrderPlanManagerService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * é£éå·¥å计åç®¡çæ¥å£ Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-04-14 |
| | | */ |
| | | @Service |
| | | public class ApsPlateOrderPlanManagerServiceImpl implements IApsPlateOrderPlanManagerService |
| | | { |
| | | @Autowired |
| | | private ApsPlateOrderPlanManagerMapper apsPlateOrderPlanManagerMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢é£éå·¥å计å管ç |
| | | * |
| | | * @param apsPlateOrderPlanManager é£éå·¥å计å管ç |
| | | * @return é£éå·¥å计å管ç |
| | | */ |
| | | @Override |
| | | public List<ApsPlateOrderPlanManager> selectApsPlanOrderManager(ApsPlateOrderPlanManager apsPlateOrderPlanManager) { |
| | | return apsPlateOrderPlanManagerMapper.selectApsPlanOrderManager(apsPlateOrderPlanManager); |
| | | } |
| | | } |
| | |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <select id="selectBomRedisData" parameterType="String" resultType="com.alibaba.fastjson2.JSONObject"> |
| | | SELECT a.item_code as mainItemCode,f.num as mainStock,b.item_code as subItemCode,b.num as usageNum,c.num as subStock,d.self_made as selfMade FROM aps_bom_header a |
| | | LEFT JOIN aps_bom_line b on a.bom_header_id=b.bom_header_id |
| | | LEFT JOIN aps_material_storage_management c on b.item_code=c.item_number |
| | | LEFT JOIN aps_material_management d on b.item_code=d.item_number |
| | | LEFT JOIN aps_material_storage_management as f on a.item_code=f.item_number |
| | | <if test="orgCode != null and orgCode != ''"> |
| | | WHERE a.org_code=#{orgCode} and d.applicable_factories=#{orgCode} and c.applicable_factories=#{orgCode} |
| | | </if> |
| | | ORDER BY mainItemCode |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.core.mapper.ApsPlateOrderPlanManagerMapper"> |
| | | |
| | | <resultMap type="ApsPlateOrderPlanManager" id="ApsPlateOrderPlanManagerResult"> |
| | | <result property="require_id" column="requireId" /> |
| | | <result property="requireTrackId" column="require_track_id" /> |
| | | <result property="docNo" column="doc_no" /> |
| | | <result property="deductionAmount" column="deduction_amount" /> |
| | | <result property="workOrderType" column="work_order_type" /> |
| | | <result property="mainPartNumber" column="main_part_number" /> |
| | | <result property="mainPartDrawingNumber" column="main_part_drawing_number" /> |
| | | <result property="customer" column="customer" /> |
| | | <result property="productionQuantity" column="production_quantity" /> |
| | | <result property="applicableFactories" column="applicable_factories" /> |
| | | <result property="productionBase" column="production_base" /> |
| | | <result property="planStartDay" column="plan_start_day" /> |
| | | <result property="planEndDay" column="plan_end_day" /> |
| | | <result property="unmatchedQuantity" column="unmatched_quantity" /> |
| | | <result property="hasDelayRisk" column="has_delay_risk" /> |
| | | </resultMap> |
| | | |
| | | <select id="selectApsPlanOrderManager" parameterType="ApsPlateOrderPlanManager" resultMap="ApsPlateOrderPlanManagerResult"> |
| | | select |
| | | detail.require_id, |
| | | detail.require_track_id, |
| | | detail.doc_no, |
| | | detail.deduction_amount, |
| | | plan.professional_affiliation as workOrderType, |
| | | plan.main_part_number as item_number, |
| | | plan.main_part_drawing_number, |
| | | plan.customer, |
| | | plan.production_quantity, |
| | | plan.plant as applicable_factories, |
| | | plan.production_base, |
| | | plan.plan_start_day, |
| | | plan.plan_end_day, |
| | | plan.unmatched_quantity, |
| | | plan.has_risk as has_delay_risk |
| | | from aps_plate_standard_require_bom_order_detail detail |
| | | left join aps_plate_plan plan on detail.doc_no = plan.document_number |
| | | <where> |
| | | <if test="workOrderNo != null and workOrderNo != ''"> and detail.doc_no = #{workOrderNo}</if> |
| | | <if test="requireId != null and requireId != ''"> and detail.require_id = #{requireId}</if> |
| | | <if test="mainPartNumber != null and mainPartNumber != ''"> and plan.main_part_number = #{mainPartNumber}</if> |
| | | <if test="hasDelayRisk != null and hasDelayRisk != ''"> and plan.has_risk = #{hasDelayRisk}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.job.domain; |
| | | |
| | | import com.aps.common.core.annotation.Excel; |
| | | import com.aps.common.core.web.domain.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * BOM Header æ°æ®ç®¡ç对象 aps_bom_header_job |
| | | * |
| | | * @author hjy |
| | | * @date 2025-05-08 |
| | | */ |
| | | public class ApsBomHeaderJob extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 主é®ID */ |
| | | private Long id; |
| | | |
| | | /** bomID */ |
| | | @JsonProperty("HID") |
| | | @Excel(name = "bomID") |
| | | private String bomHeaderId; |
| | | |
| | | /** æå· */ |
| | | @JsonProperty("HItemCode") |
| | | @Excel(name = "æå·") |
| | | private String itemCode; |
| | | |
| | | /** ç©ææè¿° */ |
| | | @JsonProperty("HItemName") |
| | | @Excel(name = "ç©ææè¿°") |
| | | private String itemName; |
| | | |
| | | /** çææ¥æ */ |
| | | @JsonProperty("HEffectiveDate") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "çææ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date startDate; |
| | | |
| | | /** å¤±ææ¥æ */ |
| | | @JsonProperty("HDisableDate") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "å¤±ææ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | |
| | | /** å·¥åç¼ç */ |
| | | @JsonProperty("HOrgName") |
| | | @Excel(name = "å·¥åç¼ç ") |
| | | private String orgCode; |
| | | |
| | | @JsonProperty("BOMLines") |
| | | private List<ApsBomLineJob> bomLines; |
| | | |
| | | /** å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼ */ |
| | | private String delFlag; |
| | | |
| | | public List<ApsBomLineJob> getBomLines() { |
| | | return bomLines; |
| | | } |
| | | |
| | | public void setBomLines(List<ApsBomLineJob> bomLines) { |
| | | this.bomLines = bomLines; |
| | | } |
| | | |
| | | public void setId(Long id) |
| | | { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getId() |
| | | { |
| | | return id; |
| | | } |
| | | |
| | | public void setBomHeaderId(String bomHeaderId) |
| | | { |
| | | this.bomHeaderId = bomHeaderId; |
| | | } |
| | | |
| | | public String getBomHeaderId() |
| | | { |
| | | return bomHeaderId; |
| | | } |
| | | |
| | | public void setItemCode(String itemCode) |
| | | { |
| | | this.itemCode = itemCode; |
| | | } |
| | | |
| | | public String getItemCode() |
| | | { |
| | | return itemCode; |
| | | } |
| | | |
| | | public void setItemName(String itemName) |
| | | { |
| | | this.itemName = itemName; |
| | | } |
| | | |
| | | public String getItemName() |
| | | { |
| | | return itemName; |
| | | } |
| | | |
| | | public void setStartDate(Date startDate) |
| | | { |
| | | this.startDate = startDate; |
| | | } |
| | | |
| | | public Date getStartDate() |
| | | { |
| | | return startDate; |
| | | } |
| | | |
| | | public void setEndDate(Date endDate) |
| | | { |
| | | this.endDate = endDate; |
| | | } |
| | | |
| | | public Date getEndDate() |
| | | { |
| | | return endDate; |
| | | } |
| | | |
| | | public void setOrgCode(String orgCode) |
| | | { |
| | | this.orgCode = orgCode; |
| | | } |
| | | |
| | | public String getOrgCode() |
| | | { |
| | | return orgCode; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("id", getId()) |
| | | .append("bomHeaderId", getBomHeaderId()) |
| | | .append("itemCode", getItemCode()) |
| | | .append("itemName", getItemName()) |
| | | .append("startDate", getStartDate()) |
| | | .append("endDate", getEndDate()) |
| | | .append("orgCode", getOrgCode()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .toString(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.job.domain; |
| | | |
| | | import com.aps.common.core.annotation.Excel; |
| | | import com.aps.common.core.web.domain.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * BOMæ°æ®ç®¡ç对象 aps_bom_line_job |
| | | * |
| | | * @author hjy |
| | | * @date 2025-05-08 |
| | | */ |
| | | public class ApsBomLineJob extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 主é®ID */ |
| | | private Long id; |
| | | |
| | | /** bom_line_id */ |
| | | @JsonProperty("LID") |
| | | @Excel(name = "bom_line_id") |
| | | private String bomLineId; |
| | | |
| | | /** ç¶èç¹BOM ID */ |
| | | @JsonProperty("HID") |
| | | @Excel(name = "ç¶èç¹BOM ID") |
| | | private String bomHeaderId; |
| | | |
| | | /** æå· */ |
| | | @JsonProperty("LItemCode") |
| | | @Excel(name = "æå·") |
| | | private String itemCode; |
| | | |
| | | /** ç©ææè¿° */ |
| | | @JsonProperty("LItemName") |
| | | @Excel(name = "ç©ææè¿°") |
| | | private String itemName; |
| | | |
| | | /** çææ¥æ */ |
| | | @JsonProperty("LEffectiveDate") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "çææ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date startDate; |
| | | |
| | | /** å¤±ææ¥æ */ |
| | | @JsonProperty("LDisableDate") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "å¤±ææ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | |
| | | /** å·¥åç¼ç */ |
| | | @JsonProperty("LOrgName") |
| | | @Excel(name = "å·¥åç¼ç ") |
| | | private String orgCode; |
| | | |
| | | /** å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼ */ |
| | | private String delFlag; |
| | | |
| | | /** å¾å· */ |
| | | @Excel(name = "å¾å·") |
| | | private String drawingNo; |
| | | |
| | | /** åºå· */ |
| | | @Excel(name = "åºå·") |
| | | private String processNo; |
| | | |
| | | /** åä½ */ |
| | | @Excel(name = "åä½") |
| | | private String unit; |
| | | |
| | | /** æ°é */ |
| | | @JsonProperty("UsageQty") |
| | | @Excel(name = "æ°é") |
| | | private BigDecimal num; |
| | | |
| | | /** æ»æ°é */ |
| | | @Excel(name = "æ»æ°é") |
| | | private BigDecimal totalNum; |
| | | |
| | | /** åå¤å·¥æ¶ */ |
| | | @Excel(name = "åå¤å·¥æ¶") |
| | | private BigDecimal preparationTime; |
| | | |
| | | /** å å·¥å·¥æ¶ */ |
| | | @Excel(name = "å 工工æ¶") |
| | | private BigDecimal processingTime; |
| | | |
| | | public void setId(Long id) |
| | | { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getId() |
| | | { |
| | | return id; |
| | | } |
| | | |
| | | public void setBomLineId(String bomLineId) |
| | | { |
| | | this.bomLineId = bomLineId; |
| | | } |
| | | |
| | | public String getBomLineId() |
| | | { |
| | | return bomLineId; |
| | | } |
| | | |
| | | public void setBomHeaderId(String bomHeaderId) |
| | | { |
| | | this.bomHeaderId = bomHeaderId; |
| | | } |
| | | |
| | | public String getBomHeaderId() |
| | | { |
| | | return bomHeaderId; |
| | | } |
| | | |
| | | public void setItemCode(String itemCode) |
| | | { |
| | | this.itemCode = itemCode; |
| | | } |
| | | |
| | | public String getItemCode() |
| | | { |
| | | return itemCode; |
| | | } |
| | | |
| | | public void setItemName(String itemName) |
| | | { |
| | | this.itemName = itemName; |
| | | } |
| | | |
| | | public String getItemName() |
| | | { |
| | | return itemName; |
| | | } |
| | | |
| | | public void setStartDate(Date startDate) |
| | | { |
| | | this.startDate = startDate; |
| | | } |
| | | |
| | | public Date getStartDate() |
| | | { |
| | | return startDate; |
| | | } |
| | | |
| | | public void setEndDate(Date endDate) |
| | | { |
| | | this.endDate = endDate; |
| | | } |
| | | |
| | | public Date getEndDate() |
| | | { |
| | | return endDate; |
| | | } |
| | | |
| | | public void setOrgCode(String orgCode) |
| | | { |
| | | this.orgCode = orgCode; |
| | | } |
| | | |
| | | public String getOrgCode() |
| | | { |
| | | return orgCode; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setDrawingNo(String drawingNo) |
| | | { |
| | | this.drawingNo = drawingNo; |
| | | } |
| | | |
| | | public String getDrawingNo() |
| | | { |
| | | return drawingNo; |
| | | } |
| | | |
| | | public void setProcessNo(String processNo) |
| | | { |
| | | this.processNo = processNo; |
| | | } |
| | | |
| | | public String getProcessNo() |
| | | { |
| | | return processNo; |
| | | } |
| | | |
| | | public void setUnit(String unit) |
| | | { |
| | | this.unit = unit; |
| | | } |
| | | |
| | | public String getUnit() |
| | | { |
| | | return unit; |
| | | } |
| | | |
| | | public void setNum(BigDecimal num) |
| | | { |
| | | this.num = num; |
| | | } |
| | | |
| | | public BigDecimal getNum() |
| | | { |
| | | return num; |
| | | } |
| | | |
| | | public void setTotalNum(BigDecimal totalNum) |
| | | { |
| | | this.totalNum = totalNum; |
| | | } |
| | | |
| | | public BigDecimal getTotalNum() |
| | | { |
| | | return totalNum; |
| | | } |
| | | |
| | | public void setPreparationTime(BigDecimal preparationTime) |
| | | { |
| | | this.preparationTime = preparationTime; |
| | | } |
| | | |
| | | public BigDecimal getPreparationTime() |
| | | { |
| | | return preparationTime; |
| | | } |
| | | |
| | | public void setProcessingTime(BigDecimal processingTime) |
| | | { |
| | | this.processingTime = processingTime; |
| | | } |
| | | |
| | | public BigDecimal getProcessingTime() |
| | | { |
| | | return processingTime; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("id", getId()) |
| | | .append("bomLineId", getBomLineId()) |
| | | .append("bomHeaderId", getBomHeaderId()) |
| | | .append("itemCode", getItemCode()) |
| | | .append("itemName", getItemName()) |
| | | .append("startDate", getStartDate()) |
| | | .append("endDate", getEndDate()) |
| | | .append("orgCode", getOrgCode()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("drawingNo", getDrawingNo()) |
| | | .append("processNo", getProcessNo()) |
| | | .append("unit", getUnit()) |
| | | .append("num", getNum()) |
| | | .append("totalNum", getTotalNum()) |
| | | .append("preparationTime", getPreparationTime()) |
| | | .append("processingTime", getProcessingTime()) |
| | | .toString(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.job.mapper; |
| | | |
| | | import com.aps.job.domain.ApsBomHeaderJob; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * BOM Header æ°æ®ç®¡çMapperæ¥å£ |
| | | * |
| | | * @author hjy |
| | | * @date 2025-05-08 |
| | | */ |
| | | public interface ApsBomHeaderJobMapper |
| | | { |
| | | /** |
| | | * æ¥è¯¢BOM Header æ°æ®ç®¡ç |
| | | * |
| | | * @param id BOM Header æ°æ®ç®¡çä¸»é® |
| | | * @return BOM Header æ°æ®ç®¡ç |
| | | */ |
| | | public ApsBomHeaderJob selectApsBomHeaderJobById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢BOM Header æ°æ®ç®¡çå表 |
| | | * |
| | | * @param apsBomHeaderJob BOM Header æ°æ®ç®¡ç |
| | | * @return BOM Header æ°æ®ç®¡çéå |
| | | */ |
| | | public List<ApsBomHeaderJob> selectApsBomHeaderJobList(ApsBomHeaderJob apsBomHeaderJob); |
| | | |
| | | /** |
| | | * æ°å¢BOM Header æ°æ®ç®¡ç |
| | | * |
| | | * @param apsBomHeaderJob BOM Header æ°æ®ç®¡ç |
| | | * @return ç»æ |
| | | */ |
| | | public int insertApsBomHeaderJob(ApsBomHeaderJob apsBomHeaderJob); |
| | | |
| | | /** |
| | | * ä¿®æ¹BOM Header æ°æ®ç®¡ç |
| | | * |
| | | * @param apsBomHeaderJob BOM Header æ°æ®ç®¡ç |
| | | * @return ç»æ |
| | | */ |
| | | public int updateApsBomHeaderJob(ApsBomHeaderJob apsBomHeaderJob); |
| | | |
| | | /** |
| | | * å é¤BOM Header æ°æ®ç®¡ç |
| | | * |
| | | * @param id BOM Header æ°æ®ç®¡çä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsBomHeaderJobById(Long id); |
| | | |
| | | /** |
| | | * æ¹éå é¤BOM Header æ°æ®ç®¡ç |
| | | * |
| | | * @param ids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsBomHeaderJobByIds(Long[] ids); |
| | | |
| | | /** |
| | | * æ¹éæå
¥BOM Headeræ°æ® |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public int insertApsBomHeaderJobBatch(@Param("list") List<ApsBomHeaderJob> list); |
| | | |
| | | /** |
| | | * æ¹éæå
¥BOM Headeræ°æ®å°ä¸å¡è¡¨ |
| | | * @return |
| | | */ |
| | | public void insertIntoApsBomHeader(); |
| | | |
| | | /** |
| | | * å é¤BOM Headeræ°æ® |
| | | * @return |
| | | */ |
| | | public void deleteApsBomHeader(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.job.mapper; |
| | | |
| | | import com.aps.job.domain.ApsBomLineJob; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * BOMæ°æ®ç®¡çMapperæ¥å£ |
| | | * |
| | | * @author hjy |
| | | * @date 2025-05-08 |
| | | */ |
| | | public interface ApsBomLineJobMapper |
| | | { |
| | | /** |
| | | * æ¥è¯¢BOMæ°æ®ç®¡ç |
| | | * |
| | | * @param id BOMæ°æ®ç®¡çä¸»é® |
| | | * @return BOMæ°æ®ç®¡ç |
| | | */ |
| | | public ApsBomLineJob selectApsBomLineJobById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢BOMæ°æ®ç®¡çå表 |
| | | * |
| | | * @param apsBomLineJob BOMæ°æ®ç®¡ç |
| | | * @return BOMæ°æ®ç®¡çéå |
| | | */ |
| | | public List<ApsBomLineJob> selectApsBomLineJobList(ApsBomLineJob apsBomLineJob); |
| | | |
| | | /** |
| | | * æ°å¢BOMæ°æ®ç®¡ç |
| | | * |
| | | * @param apsBomLineJob BOMæ°æ®ç®¡ç |
| | | * @return ç»æ |
| | | */ |
| | | public int insertApsBomLineJob(ApsBomLineJob apsBomLineJob); |
| | | |
| | | /** |
| | | * ä¿®æ¹BOMæ°æ®ç®¡ç |
| | | * |
| | | * @param apsBomLineJob BOMæ°æ®ç®¡ç |
| | | * @return ç»æ |
| | | */ |
| | | public int updateApsBomLineJob(ApsBomLineJob apsBomLineJob); |
| | | |
| | | /** |
| | | * å é¤BOMæ°æ®ç®¡ç |
| | | * |
| | | * @param id BOMæ°æ®ç®¡çä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsBomLineJobById(Long id); |
| | | |
| | | /** |
| | | * æ¹éå é¤BOMæ°æ®ç®¡ç |
| | | * |
| | | * @param ids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsBomLineJobByIds(Long[] ids); |
| | | |
| | | /** |
| | | * æ¹éæå
¥BOM Lineæ°æ®ç®¡ç |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public int insertApsBomLineJobBatch(@Param("list") List<ApsBomLineJob> list); |
| | | |
| | | /** |
| | | * æ¹éæå
¥BOM Lineæ°æ®ç®¡çå°ä¸å¡è¡¨ |
| | | * @return |
| | | */ |
| | | public void insertIntoApsBomLine(); |
| | | |
| | | /** |
| | | * å é¤BOM Lineæ°æ® |
| | | */ |
| | | public void deleteApsBomLine() ; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.job.service; |
| | | |
| | | import com.aps.job.domain.ApsBomHeaderJob; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * BOM Header æ°æ®ç®¡çServiceæ¥å£ |
| | | * |
| | | * @author hjy |
| | | * @date 2025-05-08 |
| | | */ |
| | | public interface IApsBomHeaderJobService |
| | | { |
| | | /** |
| | | * æ¥è¯¢BOM Header æ°æ®ç®¡ç |
| | | * |
| | | * @param id BOM Header æ°æ®ç®¡çä¸»é® |
| | | * @return BOM Header æ°æ®ç®¡ç |
| | | */ |
| | | public ApsBomHeaderJob selectApsBomHeaderJobById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢BOM Header æ°æ®ç®¡çå表 |
| | | * |
| | | * @param apsBomHeaderJob BOM Header æ°æ®ç®¡ç |
| | | * @return BOM Header æ°æ®ç®¡çéå |
| | | */ |
| | | public List<ApsBomHeaderJob> selectApsBomHeaderJobList(ApsBomHeaderJob apsBomHeaderJob); |
| | | |
| | | /** |
| | | * æ°å¢BOM Header æ°æ®ç®¡ç |
| | | * |
| | | * @param apsBomHeaderJob BOM Header æ°æ®ç®¡ç |
| | | * @return ç»æ |
| | | */ |
| | | public int insertApsBomHeaderJob(ApsBomHeaderJob apsBomHeaderJob); |
| | | |
| | | /** |
| | | * ä¿®æ¹BOM Header æ°æ®ç®¡ç |
| | | * |
| | | * @param apsBomHeaderJob BOM Header æ°æ®ç®¡ç |
| | | * @return ç»æ |
| | | */ |
| | | public int updateApsBomHeaderJob(ApsBomHeaderJob apsBomHeaderJob); |
| | | |
| | | /** |
| | | * æ¹éå é¤BOM Header æ°æ®ç®¡ç |
| | | * |
| | | * @param ids éè¦å é¤çBOM Header æ°æ®ç®¡ç主é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsBomHeaderJobByIds(Long[] ids); |
| | | |
| | | /** |
| | | * å é¤BOM Header æ°æ®ç®¡çä¿¡æ¯ |
| | | * |
| | | * @param id BOM Header æ°æ®ç®¡çä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsBomHeaderJobById(Long id); |
| | | |
| | | /** |
| | | * 忥U9 BOMæ°æ® |
| | | * @return |
| | | */ |
| | | public boolean syncBomData(Integer pageIndex, Integer pageSize, String orgCode, String itemCodeList); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.job.service; |
| | | |
| | | import com.aps.job.domain.ApsBomLineJob; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * BOMæ°æ®ç®¡çServiceæ¥å£ |
| | | * |
| | | * @author hjy |
| | | * @date 2025-05-08 |
| | | */ |
| | | public interface IApsBomLineJobService |
| | | { |
| | | /** |
| | | * æ¥è¯¢BOMæ°æ®ç®¡ç |
| | | * |
| | | * @param id BOMæ°æ®ç®¡çä¸»é® |
| | | * @return BOMæ°æ®ç®¡ç |
| | | */ |
| | | public ApsBomLineJob selectApsBomLineJobById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢BOMæ°æ®ç®¡çå表 |
| | | * |
| | | * @param apsBomLineJob BOMæ°æ®ç®¡ç |
| | | * @return BOMæ°æ®ç®¡çéå |
| | | */ |
| | | public List<ApsBomLineJob> selectApsBomLineJobList(ApsBomLineJob apsBomLineJob); |
| | | |
| | | /** |
| | | * æ°å¢BOMæ°æ®ç®¡ç |
| | | * |
| | | * @param apsBomLineJob BOMæ°æ®ç®¡ç |
| | | * @return ç»æ |
| | | */ |
| | | public int insertApsBomLineJob(ApsBomLineJob apsBomLineJob); |
| | | |
| | | /** |
| | | * ä¿®æ¹BOMæ°æ®ç®¡ç |
| | | * |
| | | * @param apsBomLineJob BOMæ°æ®ç®¡ç |
| | | * @return ç»æ |
| | | */ |
| | | public int updateApsBomLineJob(ApsBomLineJob apsBomLineJob); |
| | | |
| | | /** |
| | | * æ¹éå é¤BOMæ°æ®ç®¡ç |
| | | * |
| | | * @param ids éè¦å é¤çBOMæ°æ®ç®¡ç主é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsBomLineJobByIds(Long[] ids); |
| | | |
| | | /** |
| | | * å é¤BOMæ°æ®ç®¡çä¿¡æ¯ |
| | | * |
| | | * @param id BOMæ°æ®ç®¡çä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteApsBomLineJobById(Long id); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.job.service.impl; |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.aps.common.core.utils.DateUtils; |
| | | import com.aps.common.core.utils.StringUtils; |
| | | import com.aps.job.domain.ApsBomHeaderJob; |
| | | import com.aps.job.domain.ApsBomLineJob; |
| | | import com.aps.job.domain.ApsWorkOrderJobLog; |
| | | import com.aps.job.mapper.ApsBomHeaderJobMapper; |
| | | import com.aps.job.mapper.ApsBomLineJobMapper; |
| | | import com.aps.job.mapper.ApsWorkOrderJobLogMapper; |
| | | import com.aps.job.service.IApsBomHeaderJobService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * BOM Header æ°æ®ç®¡çServiceä¸å¡å±å¤ç |
| | | * |
| | | * @author hjy |
| | | * @date 2025-05-08 |
| | | */ |
| | | @Service |
| | | public class ApsBomHeaderJobServiceImpl implements IApsBomHeaderJobService |
| | | { |
| | | @Autowired |
| | | private ApsBomHeaderJobMapper apsBomHeaderJobMapper; |
| | | |
| | | @Autowired |
| | | private ApsBomLineJobMapper apsBomLineJobMapper; |
| | | |
| | | /** |
| | | * è·åè®¢åæ¥å£ |
| | | * */ |
| | | @Value("${u9.bomJobUrl}") |
| | | private String getBomUrl; |
| | | |
| | | @Autowired |
| | | private ApsWorkOrderJobLogMapper jobLogMapper; |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | /** |
| | | * æ¥è¯¢BOM Header æ°æ®ç®¡ç |
| | | * |
| | | * @param id BOM Header æ°æ®ç®¡çä¸»é® |
| | | * @return BOM Header æ°æ®ç®¡ç |
| | | */ |
| | | @Override |
| | | public ApsBomHeaderJob selectApsBomHeaderJobById(Long id) |
| | | { |
| | | return apsBomHeaderJobMapper.selectApsBomHeaderJobById(id); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢BOM Header æ°æ®ç®¡çå表 |
| | | * |
| | | * @param apsBomHeaderJob BOM Header æ°æ®ç®¡ç |
| | | * @return BOM Header æ°æ®ç®¡ç |
| | | */ |
| | | @Override |
| | | public List<ApsBomHeaderJob> selectApsBomHeaderJobList(ApsBomHeaderJob apsBomHeaderJob) |
| | | { |
| | | return apsBomHeaderJobMapper.selectApsBomHeaderJobList(apsBomHeaderJob); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢BOM Header æ°æ®ç®¡ç |
| | | * |
| | | * @param apsBomHeaderJob BOM Header æ°æ®ç®¡ç |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertApsBomHeaderJob(ApsBomHeaderJob apsBomHeaderJob) |
| | | { |
| | | apsBomHeaderJob.setCreateTime(DateUtils.getNowDate()); |
| | | return apsBomHeaderJobMapper.insertApsBomHeaderJob(apsBomHeaderJob); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹BOM Header æ°æ®ç®¡ç |
| | | * |
| | | * @param apsBomHeaderJob BOM Header æ°æ®ç®¡ç |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateApsBomHeaderJob(ApsBomHeaderJob apsBomHeaderJob) |
| | | { |
| | | apsBomHeaderJob.setUpdateTime(DateUtils.getNowDate()); |
| | | return apsBomHeaderJobMapper.updateApsBomHeaderJob(apsBomHeaderJob); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤BOM Header æ°æ®ç®¡ç |
| | | * |
| | | * @param ids éè¦å é¤çBOM Header æ°æ®ç®¡çä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteApsBomHeaderJobByIds(Long[] ids) |
| | | { |
| | | return apsBomHeaderJobMapper.deleteApsBomHeaderJobByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * å é¤BOM Header æ°æ®ç®¡çä¿¡æ¯ |
| | | * |
| | | * @param id BOM Header æ°æ®ç®¡çä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteApsBomHeaderJobById(Long id) |
| | | { |
| | | return apsBomHeaderJobMapper.deleteApsBomHeaderJobById(id); |
| | | } |
| | | |
| | | @Override |
| | | public boolean syncBomData(Integer pageIndex, Integer pageSize, String orgCode, String itemCodeList) { |
| | | try { |
| | | // 设置请æ±å¤´ |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.APPLICATION_JSON); |
| | | // 设置请æ±ä½ |
| | | while (true) { |
| | | ApsWorkOrderJobLog jobLog = new ApsWorkOrderJobLog(); |
| | | JSONObject requestBody = new JSONObject(); |
| | | requestBody.put("PageIndex", pageIndex); |
| | | requestBody.put("PageSize", pageSize); |
| | | if(!StringUtils.isEmpty(orgCode)){ |
| | | requestBody.put("OrgCode", orgCode); |
| | | } |
| | | // å建HttpEntity对象 |
| | | HttpEntity<String> request = new HttpEntity<>(requestBody.toJSONString(), headers); |
| | | // åéPOSTè¯·æ± |
| | | ResponseEntity<String> response = restTemplate.postForEntity(getBomUrl, request, String.class); |
| | | JSONObject responseBodyJson = JSONObject.parseObject(response.getBody()); |
| | | if (response.getStatusCode().is2xxSuccessful() && "200".equals(responseBodyJson.getString("status"))) { |
| | | JSONArray jsonArray = responseBodyJson.getJSONArray("data"); |
| | | if (!jsonArray.isEmpty()) { |
| | | List<ApsBomHeaderJob> headerList = new ArrayList<>(); |
| | | List<ApsBomLineJob> lineList = new ArrayList<>(); |
| | | for (Object o : jsonArray) { |
| | | //o对象ä¸ç屿§èµå¼ç»ApsBomHeaderJob对象 |
| | | JSONObject bomHeader = (JSONObject) o; |
| | | JSONArray bomLines = bomHeader.getJSONArray("BOMLines"); |
| | | ApsBomHeaderJob insertBomHeader = new ApsBomHeaderJob(); |
| | | insertBomHeader.setId(IdUtil.getSnowflakeNextId()); |
| | | insertBomHeader.setBomHeaderId(bomHeader.getString("HID")); |
| | | insertBomHeader.setItemCode(bomHeader.getString("HItemCode")); |
| | | insertBomHeader.setItemName(bomHeader.getString("HItemName")); |
| | | insertBomHeader.setStartDate(DateUtils.parseDate(bomHeader.getString("HEffectiveDate"))); |
| | | insertBomHeader.setEndDate(DateUtils.parseDate(bomHeader.getString("HDisableDate"))); |
| | | insertBomHeader.setOrgCode(bomHeader.getString("HOrgName").contains("æ²é³")?"FORTUNE":bomHeader.getString("HOrgName").contains("åé")?"FORTUNA":bomHeader.getString("HOrgName").contains("å京")?"FORTUBE":bomHeader.getString("HOrgName")); |
| | | headerList.add(insertBomHeader); |
| | | for(Object line : bomLines){ |
| | | JSONObject lineJson = (JSONObject) line; |
| | | ApsBomLineJob bomLine = new ApsBomLineJob(); |
| | | bomLine.setId(IdUtil.getSnowflakeNextId()); |
| | | bomLine.setBomHeaderId(lineJson.getString("HID")); |
| | | bomLine.setBomLineId(lineJson.getString("LID")); |
| | | bomLine.setItemCode(lineJson.getString("LItemCode")); |
| | | bomLine.setItemName(lineJson.getString("LItemName")); |
| | | bomLine.setNum(lineJson.getBigDecimal("UsageQty")); |
| | | bomLine.setStartDate(DateUtils.parseDate(lineJson.getString("LEffectiveDate"))); |
| | | bomLine.setEndDate(DateUtils.parseDate(lineJson.getString("LDisableDate"))); |
| | | bomLine.setOrgCode(lineJson.getString("LOrgName").contains("æ²é³")?"FORTUNE":lineJson.getString("LOrgName").contains("åé")?"FORTUNA":lineJson.getString("LOrgName").contains("å京")?"FORTUBE":lineJson.getString("LOrgName")); |
| | | lineList.add(bomLine); |
| | | } |
| | | } |
| | | List<ApsBomHeaderJob> temp1 = new ArrayList<>(); |
| | | for(int i=0;i<headerList.size();i++){ |
| | | temp1.add(headerList.get(i)); |
| | | if(temp1.size()>=20){ |
| | | apsBomHeaderJobMapper.insertApsBomHeaderJobBatch(temp1); |
| | | temp1 = new ArrayList<>(); |
| | | } |
| | | } |
| | | List<ApsBomLineJob> temp2 = new ArrayList<>(); |
| | | for(int j=0;j<lineList.size();j++){ |
| | | temp2.add(lineList.get(j)); |
| | | if(temp2.size()>=20){ |
| | | apsBomLineJobMapper.insertApsBomLineJobBatch(temp2); |
| | | temp2 = new ArrayList<>(); |
| | | } |
| | | } |
| | | jobLog.setRequestData(requestBody.toJSONString()); |
| | | jobLog.setPageNum(Long.valueOf(pageIndex)); |
| | | jobLog.setPageCount(Long.valueOf(pageSize)); |
| | | jobLog.setCreateTime(DateUtils.getNowDate()); |
| | | jobLog.setBizType("bom"); |
| | | jobLog.setResult("header:"+headerList.size() + " line:"+lineList.size()); |
| | | jobLogMapper.insertApsWorkOrderJobLog(jobLog); |
| | | pageIndex++; |
| | | }else{ |
| | | break; |
| | | } |
| | | }else{ |
| | | jobLog.setRequestData(requestBody.toJSONString()); |
| | | jobLog.setResponseData(response.getBody()); |
| | | jobLog.setPageNum(Long.valueOf(pageIndex)); |
| | | jobLog.setPageCount(Long.valueOf(pageSize)); |
| | | jobLog.setCreateTime(DateUtils.getNowDate()); |
| | | jobLog.setBizType("bom"); |
| | | jobLog.setResult("error"); |
| | | jobLogMapper.insertApsWorkOrderJobLog(jobLog); |
| | | break; |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.job.service.impl; |
| | | |
| | | import com.aps.common.core.utils.DateUtils; |
| | | import com.aps.job.domain.ApsBomLineJob; |
| | | import com.aps.job.mapper.ApsBomLineJobMapper; |
| | | import com.aps.job.service.IApsBomLineJobService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * BOMæ°æ®ç®¡çServiceä¸å¡å±å¤ç |
| | | * |
| | | * @author hjy |
| | | * @date 2025-05-08 |
| | | */ |
| | | @Service |
| | | public class ApsBomLineJobServiceImpl implements IApsBomLineJobService |
| | | { |
| | | @Autowired |
| | | private ApsBomLineJobMapper apsBomLineJobMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢BOMæ°æ®ç®¡ç |
| | | * |
| | | * @param id BOMæ°æ®ç®¡çä¸»é® |
| | | * @return BOMæ°æ®ç®¡ç |
| | | */ |
| | | @Override |
| | | public ApsBomLineJob selectApsBomLineJobById(Long id) |
| | | { |
| | | return apsBomLineJobMapper.selectApsBomLineJobById(id); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢BOMæ°æ®ç®¡çå表 |
| | | * |
| | | * @param apsBomLineJob BOMæ°æ®ç®¡ç |
| | | * @return BOMæ°æ®ç®¡ç |
| | | */ |
| | | @Override |
| | | public List<ApsBomLineJob> selectApsBomLineJobList(ApsBomLineJob apsBomLineJob) |
| | | { |
| | | return apsBomLineJobMapper.selectApsBomLineJobList(apsBomLineJob); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢BOMæ°æ®ç®¡ç |
| | | * |
| | | * @param apsBomLineJob BOMæ°æ®ç®¡ç |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertApsBomLineJob(ApsBomLineJob apsBomLineJob) |
| | | { |
| | | apsBomLineJob.setCreateTime(DateUtils.getNowDate()); |
| | | return apsBomLineJobMapper.insertApsBomLineJob(apsBomLineJob); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹BOMæ°æ®ç®¡ç |
| | | * |
| | | * @param apsBomLineJob BOMæ°æ®ç®¡ç |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateApsBomLineJob(ApsBomLineJob apsBomLineJob) |
| | | { |
| | | apsBomLineJob.setUpdateTime(DateUtils.getNowDate()); |
| | | return apsBomLineJobMapper.updateApsBomLineJob(apsBomLineJob); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤BOMæ°æ®ç®¡ç |
| | | * |
| | | * @param ids éè¦å é¤çBOMæ°æ®ç®¡çä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteApsBomLineJobByIds(Long[] ids) |
| | | { |
| | | return apsBomLineJobMapper.deleteApsBomLineJobByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * å é¤BOMæ°æ®ç®¡çä¿¡æ¯ |
| | | * |
| | | * @param id BOMæ°æ®ç®¡çä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteApsBomLineJobById(Long id) |
| | | { |
| | | return apsBomLineJobMapper.deleteApsBomLineJobById(id); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.job.mapper.ApsBomHeaderJobMapper"> |
| | | |
| | | <resultMap type="ApsBomHeaderJob" id="ApsBomHeaderJobResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="bomHeaderId" column="bom_header_id" /> |
| | | <result property="itemCode" column="item_code" /> |
| | | <result property="itemName" column="item_name" /> |
| | | <result property="startDate" column="start_date" /> |
| | | <result property="endDate" column="end_date" /> |
| | | <result property="orgCode" column="org_code" /> |
| | | <result property="delFlag" column="del_flag" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectApsBomHeaderJobVo"> |
| | | select id, bom_header_id, item_code, item_name, start_date, end_date, org_code, del_flag, create_by, create_time, update_by, update_time from aps_bom_header_job |
| | | </sql> |
| | | |
| | | <select id="selectApsBomHeaderJobList" parameterType="ApsBomHeaderJob" resultMap="ApsBomHeaderJobResult"> |
| | | <include refid="selectApsBomHeaderJobVo"/> |
| | | <where> |
| | | <if test="bomHeaderId != null and bomHeaderId != ''"> and bom_header_id = #{bomHeaderId}</if> |
| | | <if test="itemCode != null and itemCode != ''"> and item_code = #{itemCode}</if> |
| | | <if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if> |
| | | <if test="startDate != null "> and start_date = #{startDate}</if> |
| | | <if test="endDate != null "> and end_date = #{endDate}</if> |
| | | <if test="orgCode != null and orgCode != ''"> and org_code = #{orgCode}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectApsBomHeaderJobById" parameterType="Long" resultMap="ApsBomHeaderJobResult"> |
| | | <include refid="selectApsBomHeaderJobVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsBomHeaderJob" parameterType="ApsBomHeaderJob"> |
| | | insert into aps_bom_header_job |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="bomHeaderId != null">bom_header_id,</if> |
| | | <if test="itemCode != null">item_code,</if> |
| | | <if test="itemName != null">item_name,</if> |
| | | <if test="startDate != null">start_date,</if> |
| | | <if test="endDate != null">end_date,</if> |
| | | <if test="orgCode != null">org_code,</if> |
| | | <if test="delFlag != null">del_flag,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="bomHeaderId != null">#{bomHeaderId},</if> |
| | | <if test="itemCode != null">#{itemCode},</if> |
| | | <if test="itemName != null">#{itemName},</if> |
| | | <if test="startDate != null">#{startDate},</if> |
| | | <if test="endDate != null">#{endDate},</if> |
| | | <if test="orgCode != null">#{orgCode},</if> |
| | | <if test="delFlag != null">#{delFlag},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsBomHeaderJob" parameterType="ApsBomHeaderJob"> |
| | | update aps_bom_header_job |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="bomHeaderId != null">bom_header_id = #{bomHeaderId},</if> |
| | | <if test="itemCode != null">item_code = #{itemCode},</if> |
| | | <if test="itemName != null">item_name = #{itemName},</if> |
| | | <if test="startDate != null">start_date = #{startDate},</if> |
| | | <if test="endDate != null">end_date = #{endDate},</if> |
| | | <if test="orgCode != null">org_code = #{orgCode},</if> |
| | | <if test="delFlag != null">del_flag = #{delFlag},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteApsBomHeaderJobById" parameterType="Long"> |
| | | delete from aps_bom_header_job where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteApsBomHeaderJobByIds" parameterType="String"> |
| | | delete from aps_bom_header_job where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <insert id="insertApsBomHeaderJobBatch"> |
| | | INSERT INTO aps_bom_header_job ( |
| | | id, |
| | | bom_header_id, |
| | | item_code, |
| | | item_name, |
| | | start_date, |
| | | end_date, |
| | | org_code, |
| | | create_time |
| | | ) VALUES |
| | | <foreach collection="list" item="item" separator=","> |
| | | ( |
| | | #{item.id}, |
| | | #{item.bomHeaderId}, |
| | | #{item.itemCode}, |
| | | #{item.itemName}, |
| | | #{item.startDate}, |
| | | #{item.endDate}, |
| | | #{item.orgCode}, |
| | | now() |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <!-- æå
¥æ°æ®å° aps_bom_header --> |
| | | <insert id="insertIntoApsBomHeader"> |
| | | INSERT INTO aps_bom_header ( |
| | | id, |
| | | bom_header_id, |
| | | item_code, |
| | | item_name, |
| | | start_date, |
| | | end_date, |
| | | org_code, |
| | | create_time |
| | | ) |
| | | SELECT |
| | | id, |
| | | bom_header_id, |
| | | item_code, |
| | | item_name, |
| | | start_date, |
| | | end_date, |
| | | org_code, |
| | | now() |
| | | FROM aps_bom_header_job |
| | | </insert> |
| | | |
| | | <!-- å é¤ aps_process_route 表ä¸çæ°æ® --> |
| | | <delete id="deleteApsBomHeader"> |
| | | DELETE FROM aps_bom_header |
| | | </delete> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.job.mapper.ApsBomLineJobMapper"> |
| | | |
| | | <resultMap type="ApsBomLineJob" id="ApsBomLineJobResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="bomLineId" column="bom_line_id" /> |
| | | <result property="bomHeaderId" column="bom_header_id" /> |
| | | <result property="itemCode" column="item_code" /> |
| | | <result property="itemName" column="item_name" /> |
| | | <result property="startDate" column="start_date" /> |
| | | <result property="endDate" column="end_date" /> |
| | | <result property="orgCode" column="org_code" /> |
| | | <result property="delFlag" column="del_flag" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="drawingNo" column="drawing_no" /> |
| | | <result property="processNo" column="process_no" /> |
| | | <result property="unit" column="unit" /> |
| | | <result property="num" column="num" /> |
| | | <result property="totalNum" column="total_num" /> |
| | | <result property="preparationTime" column="preparation_time" /> |
| | | <result property="processingTime" column="processing_time" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectApsBomLineJobVo"> |
| | | select id, bom_line_id, bom_header_id, item_code, item_name, start_date, end_date, org_code, del_flag, create_by, create_time, update_by, update_time, drawing_no, process_no, unit, num, total_num, preparation_time, processing_time from aps_bom_line_job |
| | | </sql> |
| | | |
| | | <select id="selectApsBomLineJobList" parameterType="ApsBomLineJob" resultMap="ApsBomLineJobResult"> |
| | | <include refid="selectApsBomLineJobVo"/> |
| | | <where> |
| | | <if test="bomLineId != null and bomLineId != ''"> and bom_line_id = #{bomLineId}</if> |
| | | <if test="bomHeaderId != null and bomHeaderId != ''"> and bom_header_id = #{bomHeaderId}</if> |
| | | <if test="itemCode != null and itemCode != ''"> and item_code = #{itemCode}</if> |
| | | <if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if> |
| | | <if test="startDate != null "> and start_date = #{startDate}</if> |
| | | <if test="endDate != null "> and end_date = #{endDate}</if> |
| | | <if test="orgCode != null and orgCode != ''"> and org_code = #{orgCode}</if> |
| | | <if test="drawingNo != null and drawingNo != ''"> and drawing_no = #{drawingNo}</if> |
| | | <if test="processNo != null and processNo != ''"> and process_no = #{processNo}</if> |
| | | <if test="unit != null and unit != ''"> and unit = #{unit}</if> |
| | | <if test="num != null "> and num = #{num}</if> |
| | | <if test="totalNum != null "> and total_num = #{totalNum}</if> |
| | | <if test="preparationTime != null "> and preparation_time = #{preparationTime}</if> |
| | | <if test="processingTime != null "> and processing_time = #{processingTime}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectApsBomLineJobById" parameterType="Long" resultMap="ApsBomLineJobResult"> |
| | | <include refid="selectApsBomLineJobVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsBomLineJob" parameterType="ApsBomLineJob"> |
| | | insert into aps_bom_line_job |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="bomLineId != null">bom_line_id,</if> |
| | | <if test="bomHeaderId != null">bom_header_id,</if> |
| | | <if test="itemCode != null">item_code,</if> |
| | | <if test="itemName != null">item_name,</if> |
| | | <if test="startDate != null">start_date,</if> |
| | | <if test="endDate != null">end_date,</if> |
| | | <if test="orgCode != null">org_code,</if> |
| | | <if test="delFlag != null">del_flag,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="drawingNo != null">drawing_no,</if> |
| | | <if test="processNo != null">process_no,</if> |
| | | <if test="unit != null">unit,</if> |
| | | <if test="num != null">num,</if> |
| | | <if test="totalNum != null">total_num,</if> |
| | | <if test="preparationTime != null">preparation_time,</if> |
| | | <if test="processingTime != null">processing_time,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="bomLineId != null">#{bomLineId},</if> |
| | | <if test="bomHeaderId != null">#{bomHeaderId},</if> |
| | | <if test="itemCode != null">#{itemCode},</if> |
| | | <if test="itemName != null">#{itemName},</if> |
| | | <if test="startDate != null">#{startDate},</if> |
| | | <if test="endDate != null">#{endDate},</if> |
| | | <if test="orgCode != null">#{orgCode},</if> |
| | | <if test="delFlag != null">#{delFlag},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="drawingNo != null">#{drawingNo},</if> |
| | | <if test="processNo != null">#{processNo},</if> |
| | | <if test="unit != null">#{unit},</if> |
| | | <if test="num != null">#{num},</if> |
| | | <if test="totalNum != null">#{totalNum},</if> |
| | | <if test="preparationTime != null">#{preparationTime},</if> |
| | | <if test="processingTime != null">#{processingTime},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsBomLineJob" parameterType="ApsBomLineJob"> |
| | | update aps_bom_line_job |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="bomLineId != null">bom_line_id = #{bomLineId},</if> |
| | | <if test="bomHeaderId != null">bom_header_id = #{bomHeaderId},</if> |
| | | <if test="itemCode != null">item_code = #{itemCode},</if> |
| | | <if test="itemName != null">item_name = #{itemName},</if> |
| | | <if test="startDate != null">start_date = #{startDate},</if> |
| | | <if test="endDate != null">end_date = #{endDate},</if> |
| | | <if test="orgCode != null">org_code = #{orgCode},</if> |
| | | <if test="delFlag != null">del_flag = #{delFlag},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="drawingNo != null">drawing_no = #{drawingNo},</if> |
| | | <if test="processNo != null">process_no = #{processNo},</if> |
| | | <if test="unit != null">unit = #{unit},</if> |
| | | <if test="num != null">num = #{num},</if> |
| | | <if test="totalNum != null">total_num = #{totalNum},</if> |
| | | <if test="preparationTime != null">preparation_time = #{preparationTime},</if> |
| | | <if test="processingTime != null">processing_time = #{processingTime},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteApsBomLineJobById" parameterType="Long"> |
| | | delete from aps_bom_line_job where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteApsBomLineJobByIds" parameterType="String"> |
| | | delete from aps_bom_line_job where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <insert id="insertApsBomLineJobBatch"> |
| | | INSERT INTO aps_bom_line_job ( |
| | | id, |
| | | bom_line_id, |
| | | bom_header_id, |
| | | item_code, |
| | | item_name, |
| | | start_date, |
| | | end_date, |
| | | org_code, |
| | | num, |
| | | create_time |
| | | ) VALUES |
| | | <foreach collection="list" item="item" separator=","> |
| | | ( |
| | | #{item.id}, |
| | | #{item.bomLineId}, |
| | | #{item.bomHeaderId}, |
| | | #{item.itemCode}, |
| | | #{item.itemName}, |
| | | #{item.startDate}, |
| | | #{item.endDate}, |
| | | #{item.orgCode}, |
| | | #{item.num}, |
| | | now() |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <!-- æå
¥æ°æ®å° aps_bom_line --> |
| | | <insert id="insertIntoApsBomLine"> |
| | | INSERT INTO aps_bom_line ( |
| | | id, |
| | | bom_line_id, |
| | | bom_header_id, |
| | | item_code, |
| | | item_name, |
| | | start_date, |
| | | end_date, |
| | | org_code, |
| | | num, |
| | | create_time |
| | | ) |
| | | SELECT |
| | | id, |
| | | bom_line_id, |
| | | bom_header_id, |
| | | item_code, |
| | | item_name, |
| | | start_date, |
| | | end_date, |
| | | org_code, |
| | | num, |
| | | now() |
| | | FROM aps_bom_line_job |
| | | </insert> |
| | | |
| | | <!-- å é¤ aps_process_route 表ä¸çæ°æ® --> |
| | | <delete id="deleteApsBomLine"> |
| | | DELETE FROM aps_bom_line |
| | | </delete> |
| | | |
| | | </mapper> |