出库通知档新增紧急状态字段(0无,1紧急),wcs调用优先生成工作档
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.slcf.controller.param.SetEmsParam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.slcf.pojo.UserBean; |
| | | import com.slcf.bean.WaitPakOutCondition; |
| | |
| | | } |
| | | |
| | | /** |
| | | * åºåºéç¥æ¡£è®¾ç½®ä»»å¡ä¸ºç´§æ¥ç¶æ |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/waitPakOutSetEms.action", produces = "text/html; charset=UTF-8") |
| | | public String syncStocksFromSap(@RequestBody List<SetEmsParam> list) throws Exception { |
| | | Integer i = 0; |
| | | String errorTxt = ""; |
| | | if (list.size() > 0) { |
| | | // å¤æç´§æ¥ä»»å¡æ°éæ¯å¦å·²ç»è¶
è¿3个ï¼è¶
åº3个ä¸å
è®¸ç»§ç»æ°å¢ç´§æ¥ä»»å¡ |
| | | Integer emsNum = waitPakOutService.countEmsNum(); |
| | | if (emsNum < 3) { |
| | | // 设置任å¡ä¸ºç´§æ¥ç¶æ |
| | | for (SetEmsParam item : list) { |
| | | if (waitPakOutService.waitPakOutSetEms(item) > 0) { |
| | | i++; |
| | | } |
| | | } |
| | | } else { |
| | | errorTxt = "ç´§æ¥ä»»å¡å·²è¶
åº3个ï¼è¯·èå¿çå¾
ä»»å¡å®æ"; |
| | | } |
| | | } else { |
| | | throw new Error("æ°æ®å¼å¸¸"); |
| | | } |
| | | return (i == 0) ? errorTxt : i.toString(); |
| | | } |
| | | |
| | | /** |
| | | * éªè¯ç©æç¼å·æ¯å¦åå¨ |
| | | * @param did |
| | | * @return |
New file |
| | |
| | | package com.slcf.controller.param; |
| | | |
| | | public class SetEmsParam { |
| | | private String lgnum; //ä»åºå· |
| | | private int tanum; //转å¨è¯·æ±ç¼å· |
| | | private int tapos; //è¡é¡¹ç® |
| | | |
| | | public String getLgnum() { |
| | | return lgnum; |
| | | } |
| | | |
| | | public void setLgnum(String lgnum) { |
| | | this.lgnum = lgnum; |
| | | } |
| | | |
| | | public int getTanum() { |
| | | return tanum; |
| | | } |
| | | |
| | | public void setTanum(int tanum) { |
| | | this.tanum = tanum; |
| | | } |
| | | |
| | | public int getTapos() { |
| | | return tapos; |
| | | } |
| | | |
| | | public void setTapos(int tapos) { |
| | | this.tapos = tapos; |
| | | } |
| | | } |
| | |
| | | // @Select("select top (#{epage}) a.*,b.loc_desc loc_sts_name from cust_wait_pakout a,asr_bas_loc_type b where a.loc_sts=b.loc_sts and loc_no not in " |
| | | // + " (select top (#{spage}) loc_no from cust_wait_pakout order by loc_no asc) order by loc_no asc") |
| | | public List<WaitPakOutBean> queryWaitPakOutList(WaitPakOutCondition waitPakOutCon); |
| | | |
| | | public Integer waitPakOutSetEms(@Param("lgnum") String lgnum, @Param("tanum") int tanum, @Param("tapos") int tapos); |
| | | |
| | | public Integer countEmsNum(); |
| | | |
| | | // //ç»è®¡æææ°æ®æ»æ°é |
| | | // @Select("select count(*) from cust_wait_pakout") |
| | |
| | | private String bname; //ç¨æ·ID |
| | | private int action; //0.é»è®¤ 1.åç¬ç¡®è®¤ 2.åç¬æå° 3.æ¢æå°å确认 |
| | | private int prnstatus; //0é»è®¤,1éè¦æå°,2æå°å®æ,3æå°é误 |
| | | private int ems_status; // æ¯å¦ç´§æ¥ |
| | | |
| | | private String sheet_no; //åå· |
| | | private String mat_no; //ç©æç¼ç |
| | |
| | | this.date1 = date1; |
| | | } |
| | | |
| | | public int getEms_status() { |
| | | return ems_status; |
| | | } |
| | | |
| | | public void setEms_status(int ems_status) { |
| | | this.ems_status = ems_status; |
| | | } |
| | | } |
| | |
| | | import java.util.Map; |
| | | |
| | | import com.slcf.bean.WaitPakOutCondition; |
| | | import com.slcf.controller.param.SetEmsParam; |
| | | import com.slcf.pojo.WaitPakOutBean; |
| | | |
| | | /** |
| | |
| | | //æ¥è¯¢ææ |
| | | public Map<String,Object> queryWaitPakOutList(WaitPakOutCondition waitPakOutCon); |
| | | |
| | | public Integer waitPakOutSetEms(SetEmsParam waitPakOutCon); |
| | | |
| | | public Integer countEmsNum(); |
| | | |
| | | //æ ¹æ®idæ¥è¯¢ |
| | | public WaitPakOutBean queryWaitPakOutById(String sheet_no,String mat_no); |
| | | |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.slcf.controller.param.SetEmsParam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | // } |
| | | // } |
| | | |
| | | public Integer waitPakOutSetEms(SetEmsParam setEmsParam) { |
| | | return WaitPakOutDao.waitPakOutSetEms(setEmsParam.getLgnum(), setEmsParam.getTanum(), setEmsParam.getTapos()); |
| | | } |
| | | |
| | | public Integer countEmsNum() { |
| | | return WaitPakOutDao.countEmsNum(); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®idæ¥æ¾ |
| | | */ |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | <update id="waitPakOutSetEms"> |
| | | update cust_wait_pakout set ems_status = 1 where lgnum=#{lgnum} and tanum = #{tanum} and tapos = #{tapos} |
| | | </update> |
| | | |
| | | <select id="countEmsNum" resultType="integer"> |
| | | select count(*) from cust_wait_pakout where ems_status = 1 |
| | | </select> |
| | | |
| | | <select id="getWaitPakOutCount" parameterType="com.slcf.bean.WaitPakOutCondition" resultType="Integer"> |
| | | select count(1) from cust_wait_pakout a |
| | | <where> |
| | |
| | | <!-- <mvc:annotation-driven /> --> |
| | | <mvc:annotation-driven> |
| | | <mvc:message-converters> |
| | | <bean class="org.springframework.http.converter.StringHttpMessageConverter" /> <!--å
è¿è¡string转æ¢--> |
| | | <bean |
| | | class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"> |
| | | <property name="supportedMediaTypes"> |
| | |
| | | <div class="table-responsive"> |
| | | <!-- <div style="overflow:scroll;"> --> |
| | | <!-- <table id="test-table" class="table table-hover table-striped table-condensed table-bordered"></table> --> |
| | | <button type="button" onclick="emsBtn()" class="btn btn-danger">ç´§æ¥</button> |
| | | <table id="test-table" class="table table-hover text-nowrap"></table> |
| | | </div> |
| | | |
| | |
| | | showRefresh : false, //æ¾ç¤ºå·æ°æé® |
| | | showExport : false, |
| | | toolbar:"#toolbar", |
| | | singleselect : true, |
| | | singleSelect : true, |
| | | clickToSelect: true, // åå»è¡å³å¯ä»¥éä¸ |
| | | search : false,//æ¾ç¤ºæç´ 表å |
| | | silent : true, //å·æ°äºä»¶å¿
须设置 |
| | |
| | | return 'åºåºå®æ'; |
| | | }else if(value=='X'){ |
| | | return '忥å¼å¸¸'; |
| | | } |
| | | } |
| | | }, { |
| | | field: "ems_status", |
| | | title: "ç´§æ¥ç¶æ", |
| | | align: "center", |
| | | valign: "middle", |
| | | sortable: "true", |
| | | formatter: function (value, row, index) { |
| | | if (value == 0) { |
| | | return 'æ '; |
| | | } else if (value == 1) { |
| | | return '<span style="color: red">ç´§æ¥</span>'; |
| | | } |
| | | } |
| | | }, { |
| | |
| | | alert("请è³å°éä¸ä¸è¡æ°æ®"); |
| | | } |
| | | } |
| | | |
| | | /* 设置éç¥æ¡£ä¸ºç´§æ¥ä»»å¡ */ |
| | | function emsBtn() { |
| | | // è·åå½åè¡ |
| | | var row = $("#test-table").bootstrapTable('getSelections'); |
| | | var paramList = []; |
| | | if (row.length > 0) { |
| | | row.map(function (item) { |
| | | paramList.push({ |
| | | lgnum: item.lgnum, |
| | | tanum: item.tanum, |
| | | tapos: item.tapos, |
| | | }) |
| | | }); |
| | | } |
| | | if(confirm('æ¨ç¡®å®è¦è®¾ç½®è¯¥ä»»å¡ä¸ºç´§æ¥ç¶æå')){ |
| | | $.ajax({ |
| | | url: 'work/waitPakOutSetEms.action', |
| | | type:'post', |
| | | dataType:'text', |
| | | contentType:"application/json", |
| | | data: JSON.stringify(paramList), |
| | | success: function (data) { |
| | | if (isNaN(Number(data))) { |
| | | alert(data); |
| | | } |
| | | $('#test-table').bootstrapTable('refresh'); |
| | | }, |
| | | error: function () { |
| | | alert("请æ±å¤±è´¥ï¼"); |
| | | } |
| | | }); |
| | | } |
| | | } |
New file |
| | |
| | | alter table cust_wait_pakout add ems_status int default 0 |
| | | // æå岿°æ®ä¿®çems_statusä¿®æ¹ä¸º0 |
| | | update cust_wait_pakout set ems_status = 0 |