[update]工单同步类 补充 process_status 字段
| | |
| | | package com.aps.job.domain; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.aps.common.core.annotation.Excel; |
| | |
| | | |
| | | /** 同步主键 */ |
| | | @Excel(name = "同步主键") |
| | | @JsonProperty("ID") |
| | | private String orderId; |
| | | |
| | | /** 单据号 */ |
| | |
| | | |
| | | /** 工作中心 当前在制的工序 */ |
| | | @Excel(name = "工作中心 当前在制的工序") |
| | | private Integer workCenter; |
| | | private String workCenter; |
| | | |
| | | /** 所属部门 */ |
| | | @Excel(name = "所属部门") |
| | |
| | | /** 删除标志(0代表存在 2代表删除) */ |
| | | @Excel(name = "删除标志", readConverterExp = "0=代表存在,2=代表删除") |
| | | private String delFlag; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | private String orgCode; |
| | | |
| | | public void setId(Long id) |
| | | { |
| | |
| | | return opNum; |
| | | } |
| | | |
| | | public void setWorkCenter(Integer workCenter) |
| | | public void setWorkCenter(String workCenter) |
| | | { |
| | | this.workCenter = workCenter; |
| | | } |
| | | |
| | | public Integer getWorkCenter() |
| | | public String getWorkCenter() |
| | | { |
| | | return workCenter; |
| | | } |
| | |
| | | { |
| | | return delFlag; |
| | | } |
| | | public String getProcessStatus() { |
| | | return processStatus; |
| | | } |
| | | |
| | | public void setProcessStatus(String processStatus) { |
| | | this.processStatus = processStatus; |
| | | } |
| | | |
| | | private String processStatus; |
| | | |
| | | public String getOrgCode() { |
| | | return orgCode; |
| | | } |
| | | |
| | | public void setOrgCode(String orgCode) { |
| | | this.orgCode = orgCode; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.APPLICATION_JSON); |
| | | Integer PageIndex=1; |
| | | Integer PageSize=10; |
| | | Integer PageSize=500; |
| | | Boolean continueFlag=true; |
| | | /* while (continueFlag){*/ |
| | | JSONObject requestBody = new JSONObject(); |
| | |
| | | HttpEntity<String> request = new HttpEntity<>(requestBody.toJSONString(), headers); |
| | | ResponseEntity<String> response = restTemplate.postForEntity(getWorkOrderUrl, request, String.class); |
| | | if (response.getStatusCode().is2xxSuccessful()) { |
| | | String responseBody = response.getBody(); |
| | | if(StringUtils.isNotEmpty(responseBody)){ |
| | | JSONObject responseBodyJson = JSONObject.parseObject(responseBody); |
| | | JSONObject responseBodyJson = JSONObject.parseObject(response.getBody()); |
| | | if("200".equals(responseBodyJson.getString("status"))){ |
| | | JSONArray result = responseBodyJson.getJSONArray("data"); |
| | | List<ApsWorkOrderJob> jobs = new ArrayList<>(); |
| | | if (result!=null){ |
| | | List<ApsWorkOrderJob> jobs = new ArrayList<>(); |
| | | for (int i = 0; i < result.size(); i++) { |
| | | ApsWorkOrderJob order = result.getObject(i, ApsWorkOrderJob.class); |
| | | JSONObject jsonObject = result.getJSONObject(i); |
| | | order.setOrderId(jsonObject.get("ID").toString()); |
| | | order.setCreateTime(DateUtils.getNowDate()); |
| | | order.setPageIndex(i); |
| | | order.setPageNum(PageIndex); |
| | | order.setDelFlag("0"); |
| | | jobs.add(order); |
| | | } |
| | | } |
| | | apsWorkOrderJobMapper.batchInsertApsWorkOrderJob(jobs); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | /* }*/ |
| | | } |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectApsWorkOrderJobVo"> |
| | | select id, order_id, doc_no, mainitem_code, mainitem_figure, customer_name, business_type, demand_type, doc_status, item_code, item_figure, item_figure_version, pruduct_qty, work_qty, op_num, work_center, dept, start_date, complete_date, next_dept, is_hold_release, is_out_source, org, page_num, page_index, del_flag, create_by, create_time, update_by, update_time from aps_work_order_job |
| | | select id, order_id, doc_no, mainitem_code, mainitem_figure, customer_name, business_type, demand_type, |
| | | doc_status, item_code, item_figure, item_figure_version, pruduct_qty, work_qty, op_num, work_center, |
| | | dept, start_date, complete_date, next_dept, is_hold_release, is_out_source, org, page_num, page_index, |
| | | del_flag, create_by, create_time, update_by, update_time , process_status,org_code |
| | | from aps_work_order_job |
| | | </sql> |
| | | |
| | | <select id="selectApsWorkOrderJobList" parameterType="ApsWorkOrderJob" resultMap="ApsWorkOrderJobResult"> |
| | |
| | | <if test="org != null and org != ''"> and org = #{org}</if> |
| | | <if test="pageNum != null "> and page_num = #{pageNum}</if> |
| | | <if test="pageIndex != null "> and page_index = #{pageIndex}</if> |
| | | <if test="orgCode != null and orgCode != ''"> and org_code = #{orgCode}</if> |
| | | <if test="processStatus != null and processStatus != ''"> and process_status = #{processStatus}</if> |
| | | <if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if> |
| | | </where> |
| | | </select> |
| | |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="orgCode != null">org_code,</if> |
| | | <if test="processStatus != null">process_status,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="orderId != null">#{orderId},</if> |
| | |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="orgCode != null">#{orgCode},</if> |
| | | <if test="processStatus != null">#{processStatus},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | create_by, |
| | | create_time, |
| | | update_by, |
| | | update_time |
| | | update_time, |
| | | org_code, |
| | | process_status |
| | | </trim> |
| | | values |
| | | <foreach collection="list" item="job" separator=","> |
| | |
| | | #{job.createBy}, |
| | | #{job.createTime}, |
| | | #{job.updateBy}, |
| | | #{job.updateTime} |
| | | #{job.updateTime}, |
| | | #{job.orgCode}, |
| | | #{job.processStatus} |
| | | ) |
| | | </foreach> |
| | | </insert> |