| | |
| | | public void saveInoutFiles(List<FileData> files, String companyId, |
| | | String bizId, String bizTag) throws Exception, SQLException { |
| | | |
| | | if (files.size() == 0) |
| | | return; |
| | | if (null == files || files.size() == 0) return; |
| | | |
| | | for (FileData data : files) { |
| | | // å¦ææ²¡æéä»¶åç§°ï¼åä¸ä¿åéä»¶ä¿¡æ¯ |
| | |
| | | @PropertyDef(label = "åºåºæµç¨é
ç½®", description = "使ç¨-线éå¼çæµç¨é
ç½®") |
| | | private String progressOut; |
| | | |
| | | @Column(name = "NOTICE_TAG_IN_", length = 1) |
| | | @PropertyDef(label = "å
¥åºéç¥åæ è®°") |
| | | private String noticeTagIn = Constant.YN_Y; |
| | | |
| | | @Column(name = "NOTICE_TAG_OUT_", length = 1) |
| | | @PropertyDef(label = "åºåºéç¥åæ è®°") |
| | | private String noticeTagOut = Constant.YN_Y; |
| | | // @Column(name = "NOTICE_TAG_IN_", length = 1) |
| | | // @PropertyDef(label = "å
¥åºéç¥åæ è®°") |
| | | // private String noticeTagIn = Constant.YN_Y; |
| | | // |
| | | // @Column(name = "NOTICE_TAG_OUT_", length = 1) |
| | | // @PropertyDef(label = "åºåºéç¥åæ è®°") |
| | | // private String noticeTagOut = Constant.YN_Y; |
| | | |
| | | |
| | | @Column(name = "NOTICE_WX_", length = 1) |
| | |
| | | import com.ld.igds.constant.RespCodeEnum; |
| | | import com.ld.igds.data.PageResponse; |
| | | import com.ld.igds.inout.manager.CheckManager; |
| | | import com.ld.igds.io.dto.CheckResultParam; |
| | | import com.ld.igds.io.sample.data.SampleDto; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | * @data:2020å¹´3æ22æ¥ |
| | | * |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("api/check") |
| | | public class CheckController { |
| | |
| | | @RequestMapping("/get-plateNum") |
| | | public PageResponse<ApiInoutData> getPlateNum(@RequestBody ApiInoutData param) { |
| | | |
| | | if (StringUtils.isEmpty(param.getProtocol())) { |
| | | param.setErrorMsg("å½å车çè¯å«æªé
ç½®é讯åè®®ï¼æ æ³æ§è¡"); |
| | | return new PageResponse<>(RespCodeEnum.CODE_1007, param); |
| | | if (null == param.getIp()) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(), "åºå
¥åºé
ç½®ä¸æ²¡æé
ç½®å¦å
¥ç»è®°ç车çè¯å«"); |
| | | } |
| | | |
| | | if (null == param.getIp()) { |
| | | param.setErrorMsg("åºå
¥åºé
ç½®ä¸æ²¡æé
ç½®å¦å
¥ç»è®°ç车çè¯å«"); |
| | | return new PageResponse<>(RespCodeEnum.CODE_1007, param); |
| | | if (StringUtils.isEmpty(param.getProtocol())) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(), "å½å车çè¯å«æªé
ç½®é讯åè®®ï¼æ æ³æ§è¡"); |
| | | } |
| | | |
| | | param = inoutDeviceManager.getPlateNum(param); |
| | |
| | | } |
| | | |
| | | /** |
| | | * è·å车çè¯å«ä¿¡æ¯ |
| | | * è·åæºæ
§å¡ä¿¡æ¯ |
| | | * |
| | | * @param param 车çè¯å«æ°æ®ä¿¡æ¯ |
| | | * @param param è·åæºæ
§å¡ä¿¡æ¯ |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | |
| | | public PageResponse<ApiInoutData> getIcCardNum(@RequestBody ApiInoutData param) { |
| | | |
| | | if (StringUtils.isEmpty(param.getProtocol())) { |
| | | param.setErrorMsg("å½åæºæ
§å¡æªé
ç½®é讯åè®®ï¼æ æ³æ§è¡"); |
| | | return new PageResponse<>(RespCodeEnum.CODE_1007, param); |
| | | return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(), "å½åæºæ
§å¡æªé
ç½®é讯åè®®ï¼æ æ³æ§è¡"); |
| | | } |
| | | |
| | | if (null == param.getIp()) { |
| | | param.setErrorMsg("åºå
¥åºé
ç½®ä¸æ²¡æé
ç½®æºæ
§å¡ä¿¡æ¯"); |
| | | return new PageResponse<>(RespCodeEnum.CODE_1007, param); |
| | | return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(), "åºå
¥åºé
ç½®ä¸æ²¡æé
ç½®æºæ
§å¡ä¿¡æ¯"); |
| | | } |
| | | |
| | | param = inoutDeviceManager.getIcCardNum(param); |
| | |
| | | @Transactional |
| | | public PageResponse<InoutData> inoutNextStep(@RequestBody InoutData data) { |
| | | try { |
| | | IUser user = ContextUtil.getLoginUser(); |
| | | if (StringUtils.isEmpty(data.getCompanyId())) { |
| | | data.setCompanyId(user.getCompanyId()); |
| | | } |
| | | if (StringUtils.isEmpty(data.getDeptId())) { |
| | | data.setDeptId(ContextUtil.subDeptId(user)); |
| | | } |
| | | |
| | | if (InoutConstant.TYPE_IN.equals(data.getType())) { |
| | | return inoutManager.inNextStep(data); |
| | | } else { |
| | |
| | | return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), |
| | | "åå°å¼å¸¸ï¼" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åºå
¥åºæ°æ®ä¿åï¼ç»è®°æäº¤ |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | @RequestMapping("/submit-register") |
| | | @Transactional |
| | | public PageResponse<InoutData> submitRegister(@RequestBody InoutData data) throws Exception { |
| | | IUser user = ContextUtil.getLoginUser(); |
| | | if (StringUtils.isEmpty(data.getCompanyId())) { |
| | | data.setCompanyId(user.getCompanyId()); |
| | | } |
| | | if (StringUtils.isEmpty(data.getDeptId())) { |
| | | data.setDeptId(ContextUtil.subDeptId(user)); |
| | | } |
| | | |
| | | //å¦ææ³¨åæ¶åæ²¡æä½¿ç¨æºæ
§å¡ï¼é»è®¤ä½¿ç¨èº«ä»½è¯å·ä½ä¸ºæºæ
§å¡å· |
| | | if (StringUtils.isEmpty(data.getIntelCard())) { |
| | | data.setIntelCard(data.getUserId()); |
| | | } |
| | | |
| | | return inoutManager.submitRegisterInout(data); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°ç¨æ·éæ©å°ç£
ï¼æ ¹æ®ç¨æ·IPä¿åæéæ© |
| | | * |
| | |
| | | |
| | | public PageResponse<InoutData> inNextStep(InoutData data) throws Exception { |
| | | String msg; |
| | | IUser user = ContextUtil.getLoginUser(); |
| | | if (StringUtils.isEmpty(data.getCompanyId())) { |
| | | data.setCompanyId(user.getCompanyId()); |
| | | } |
| | | if (StringUtils.isEmpty(data.getDeptId())) { |
| | | data.setDeptId(ContextUtil.subDeptId(user)); |
| | | } |
| | | |
| | | String curProgress = data.getProgress(); |
| | | List<FileData> files = data.getFiles(); |
| | | |
| | | if (StringUtils.isEmpty(data.getIntelCard())) { |
| | | data.setIntelCard(data.getUserId()); |
| | | } |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | private String getNextProgress(String curProgress, String type, |
| | | InoutSysConf sysConf) { |
| | | private String getNextProgress(String curProgress, String type, InoutSysConf sysConf) { |
| | | String nextProgress = null; |
| | | List<String> list = null; |
| | | if (InoutConstant.TYPE_IN.equals(type)) { |
| | |
| | | * å é¤æä½ å 餿°æ®ä¸ºè½¯å é¤ï¼å 餿°æ®åéè¦æ ¹æ®å 餿
åµèå¨åºåçä¿¡æ¯ |
| | | * |
| | | * @param data |
| | | * @param selected |
| | | * æ¯å¦å·²ç»æ¥è¯¢è¿æ°æ® |
| | | * @param selected æ¯å¦å·²ç»æ¥è¯¢è¿æ°æ® |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æä½éé¸è®¾å¤ |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | |
| | | |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "", null); |
| | | } |
| | | |
| | | /** |
| | | * åºå
¥åºæ³¨åæ°æ®æäº¤ï¼å
¥åºç»è®°ååºå
¥åºç»è®°ä½¿ç¨åä¸ä¸ªæ¹æ³ |
| | | * |
| | | * @param data |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public PageResponse<InoutData> submitRegisterInout(InoutData data) throws Exception { |
| | | |
| | | //é¦å
夿æµç¨ä¸æ¯å¦æå·²ç»åå¨ç车è¾ä¿¡æ¯æªæ§è¡å®æï¼ç´æ¥ä»æ°æ®åºä¸æ¥è¯¢ |
| | | InoutParam param = new InoutParam(); |
| | | param.setCompanyId(data.getCompanyId()); |
| | | param.setPlateNum(data.getPlateNum()); |
| | | param.setIntelCard(data.getIntelCard()); |
| | | param.setType(data.getType()); |
| | | param.setStart(DateUtil.getNewByDay(null, -10)); |
| | | |
| | | int num = inoutService.checkExist(param); |
| | | if (num > 0) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), |
| | | "å½åè½¦çææºæ
§å¡ææ£å¨æ§è¡æµç¨æªç»æï¼è¯·è系管çå", data); |
| | | } |
| | | |
| | | |
| | | //è·åç³»ç»åæ°é
ç½® |
| | | InoutSysConf inoutSysConf = inoutManagerService.getCacheInoutSysConf(data.getCompanyId(), data.getDeptId()); |
| | | if (null == inoutSysConf) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), |
| | | "æç¤ºï¼å½ååºåºæªé
ç½®åºå
¥åºæµç¨ä¿¡æ¯ï¼è¯·è系管çå", data); |
| | | } |
| | | |
| | | String curProgress = data.getProgress(); |
| | | |
| | | //è·åä¸ä¸ä¸ªæµç¨ç¶æ |
| | | String nextProgress = getNextProgress(curProgress, data.getType(), inoutSysConf); |
| | | data.setRegisterTime(new Date()); |
| | | data.setRegisterUser(ContextUtil.getLoginUserCName()); |
| | | data.setProgress(nextProgress); |
| | | |
| | | String msg = inoutService.insertData(data); |
| | | |
| | | if (null != msg) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), |
| | | msg, data); |
| | | } |
| | | |
| | | // æ§è¡éä»¶ä¿¡æ¯ |
| | | fileService.saveInoutFiles(data.getFiles(), data.getCompanyId(), data.getId(), curProgress); |
| | | |
| | | |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "æ§è¡æå", data); |
| | | } |
| | | |
| | | } |
| | |
| | | * æ´æ°åºå
¥åºæµæ°´å®æ¶åºå |
| | | * |
| | | * @param param |
| | | * @return |
| | | |
| | | int updateCuStorage(@Param("param") InoutParam param); |
| | | * @return int updateCuStorage(@Param("param") InoutParam param); |
| | | */ |
| | | |
| | | /** |
| | |
| | | void toComplete(@Param("param") InoutParam param); |
| | | |
| | | /** |
| | | * è·åå
¥åºå®æé |
| | | * |
| | | * @param param |
| | | * @return |
| | | |
| | | CommonData getInComplete(@Param("param") NoticeParam param); |
| | | */ |
| | | |
| | | /** |
| | | * è·ååºåºå®æé |
| | | * |
| | | * @param param |
| | | * @return |
| | | |
| | | CommonData getOutComplete(@Param("param") NoticeParam param); |
| | | */ |
| | | |
| | | /** |
| | | * è·åæµç¨æªå®æçæµæ°´æ°æ® |
| | | * |
| | | * @param page |
| | |
| | | * @return CommonData.numValue1 |
| | | */ |
| | | CommonData sumRecordWeight(@Param("param") InoutParam param); |
| | | |
| | | /** |
| | | * æ ¹æ®è½¦çå·åå¡å·æ¥è¯¢æ¯å¦ææªå®æçæµç¨ä¿¡æ¯ |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | int checkExist(@Param("param") InoutParam param); |
| | | } |
| | |
| | | * @return è¿åå¼å¸¸ä¿¡æ¯ï¼æ£å¸¸è¿ånull |
| | | * @throws Exception |
| | | */ |
| | | String insertData(InoutData data) throws Exception; |
| | | String insertData(InoutData data); |
| | | |
| | | /** |
| | | * æ´æ°æ°æ® |
| | |
| | | * @return |
| | | */ |
| | | double sumRecordWeight(InoutParam param); |
| | | |
| | | /** |
| | | * æ°æ®åºæ ¹æ®è½¦çå·åæºæ
§å¡å·æ¯å¦å·²ç»åå¨ |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | int checkExist(InoutParam param); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public String insertData(InoutData data) { |
| | | try { |
| | | data.setUpdateTime(new Date()); |
| | | |
| | | if (StringUtils.isEmpty(data.getCompanyId())) { |
| | | data.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | |
| | | // è·åå½åä»åºçå®é
åºå |
| | | if (StringUtils.isNotEmpty(data.getDepotId())) { |
| | | if (null == data.getFoodYear() || null == data.getFoodType()) { |
| | | Depot depot = commonService.getCacheDepot(data.getCompanyId(), data.getDepotId()); |
| | | if (null == data.getFoodYear()) { |
| | | data.setFoodYear(depot.getFoodYear()); |
| | | } |
| | | if (null == data.getFoodType()) { |
| | | data.setFoodType(depot.getFoodType()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (null == data.getRegisterTime()) { |
| | | data.setRegisterTime(new Date()); |
| | | if (null == data.getDeptId()) { |
| | | data.setDeptId(ContextUtil.subDeptId(null)); |
| | | } |
| | | |
| | | String id = this.createId(data.getRegisterTime(), data.getCompanyId()); |
| | | |
| | | if (StringUtils.isEmpty(data.getId())) { |
| | | if (InoutConstant.TYPE_IN.equals(data.getType())) { |
| | | data.setId("R_" + id); |
| | |
| | | if (StringUtils.isEmpty(data.getCheckId())) { |
| | | data.setCheckId(id); |
| | | } |
| | | if (null == data.getDeptId()) { |
| | | data.setDeptId(ContextUtil.subDeptId(null)); |
| | | } |
| | | |
| | | if (null == data.getUserName()) { |
| | | data.setUserName(""); |
| | | } |
| | | |
| | | inoutMapper.insertData(data); |
| | | |
| | | // 妿䏿¯æå¨è¡¥å½çæ°æ®ï¼æ·»å å°ç¼åä¸ |
| | | if (!InoutConstant.RECORD_STATUS_ADD.equals(data.getRecordStatus())) { |
| | | this.addInoutCache(data); |
| | | |
| | | } catch (Exception e) { |
| | | log.error("------------åºå
¥åºæ§è¡ä¿ååºé---{}", e); |
| | | return "åå°å¼å¸¸ï¼" + e.getMessage(); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | |
| | | return result.getNumValue1(); |
| | | } |
| | | |
| | | @Override |
| | | public int checkExist(InoutParam param) { |
| | | return inoutMapper.checkExist(param); |
| | | } |
| | | |
| | | /** |
| | | * æªå®ææµç¨åå
¥ç¼å |
| | | * |
| | |
| | | import com.ld.igds.models.InoutConf; |
| | | import com.ld.igds.models.InoutSysConf; |
| | | import com.ld.igds.util.ContextUtil; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.hibernate.Session; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | return null; |
| | | } |
| | | |
| | | public List<InoutSysConf> getSysConfData(Map<String, Object> param) { |
| | | |
| | | Map<String, Object> args = new HashMap<String, Object>(); |
| | | String hql = " from " + InoutSysConf.class.getName() |
| | | + " where companyId=:companyId and deptId=:deptId"; |
| | | |
| | | args.put("companyId", ContextUtil.getCompanyId()); |
| | | String deptId = ""; |
| | | if (null != param) { |
| | | deptId = (String) param.get("deptId"); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(deptId)) { |
| | | deptId = ContextUtil.subDeptId(null); |
| | | } |
| | | |
| | | args.put("deptId", deptId); |
| | | |
| | | return this.query(hql, args); |
| | | } |
| | | |
| | | public String saveSysConfData(InoutSysConf data) { |
| | | Session session = this.getSessionFactory().openSession(); |
| | | try { |
| | | if (StringUtils.isEmpty(data.getDeptId())) { |
| | | data.setDeptId(ContextUtil.subDeptId(null)); |
| | | data.setCompanyId(ContextUtil.getCompanyId()); |
| | | session.save(data); |
| | | } else { |
| | | session.update(data); |
| | | } |
| | | |
| | | session.saveOrUpdate(data); |
| | | } finally { |
| | | session.flush(); |
| | | session.close(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public InoutSysConf getSysConfData(String companyId, String deptId) { |
| | | |
| | | String hql = " from " + InoutSysConf.class.getName() |
| | | + " where companyId=:companyId and deptId=:deptId"; |
| | | |
| | | Map<String, Object> args = new HashMap<String, Object>(); |
| | | args.put("companyId", companyId); |
| | | args.put("deptId", deptId); |
| | | |
| | | List<InoutSysConf> list = this.query(hql, args); |
| | | |
| | | if(null == list || list.isEmpty()) return new InoutSysConf(); |
| | | |
| | | return list.get(0); |
| | | } |
| | | } |
| | |
| | | |
| | | InoutSysConf inoutSysConf = inoutManagerService.getCacheInoutSysConf(companyId, deptId); |
| | | |
| | | if(Constant.YN_Y.equals(inoutSysConf.getNoticeTagIn())){ |
| | | List<InoutNoticeIn> noticeInList = inoutManagerService.getUnComNoticeIn(companyId); |
| | | |
| | | if (noticeInList != null && noticeInList.size() > 0) { |
| | | inoutManagerService.updateSumNoticeIn(inoutSysConf.getDeptId(), noticeInList); |
| | | return "success"; |
| | | } |
| | | } |
| | | |
| | | |
| | | return "fail"; |
| | | } |
| | | |
| | |
| | | |
| | | InoutSysConf inoutSysConf = inoutManagerService.getCacheInoutSysConf(companyId, deptId); |
| | | |
| | | if(Constant.YN_Y.equals(inoutSysConf.getNoticeTagOut())){ |
| | | List<InoutNoticeOut> noticeOutList = inoutManagerService.getUnComNoticeOut(companyId); |
| | | |
| | | if (noticeOutList != null && noticeOutList.size() > 0) { |
| | | inoutManagerService.updateSumNoticeOut(inoutSysConf.getDeptId(), noticeOutList); |
| | | return "success"; |
| | | } |
| | | } |
| | | return "fail"; |
| | | } |
| | |
| | | <PropertyDef name="companyId"> |
| | | <Property></Property> |
| | | <Property name="label">ç»ç»ç¼ç </Property> |
| | | <Property name="required">true</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="deptId"> |
| | | <Property></Property> |
| | |
| | | <PropertyDef name="progressOut"> |
| | | <Property></Property> |
| | | <Property name="label">åºåºæµç¨</Property> |
| | | <Property name="required">true</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="noticeTagIn"> |
| | | <Property></Property> |
| | | <Property name="label">å
¥åºéç¥åå¯ç¨</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("inoutSysConfPR#triggerYesOrNo").getResult()}</Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | <Property name="required">true</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="noticeTagOut"> |
| | | <Property></Property> |
| | | <Property name="label">åºåºéç¥åå¯ç¨</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("inoutSysConfPR#triggerYesOrNo").getResult()}</Property> |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | <Property name="required">true</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="noticeWx"> |
| | |
| | | </DataType> |
| | | </Model> |
| | | <View layout="padding:5;regionPadding:5"> |
| | | <ClientEvent name="onReady">var deptId = "${request.getParameter('deptId')}";
 |
| | | 
 |
| | | //æ¥è¯¢
 |
| | | query = function(){
 |
| | | var data = {deptId:deptId};
 |
| | | view.get("#dsMain").set("parameter",data).flushAsync();
 |
| | | };
 |
| | | query();</ClientEvent> |
| | | <Property name="packages">font-awesome,css-common</Property> |
| | | <DataSet id="dsMain"> |
| | | <Property name="dataProvider">inoutSysConfPR#getSysConfData</Property> |
| | | <Property name="dataType">dtMain</Property> |
| | | <Property name="loadMode">manual</Property> |
| | | </DataSet> |
| | | <Container layout="regionPadding:10" layoutConstraint="top"> |
| | | <Property name="exClassName">bg-color</Property> |
| | |
| | | <Property name="name">progressOut</Property> |
| | | <Property name="property">progressOut</Property> |
| | | <Property name="editorType">TextArea</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <Label layoutConstraint="colSpan:3"/> |
| | | <Control/> |
| | | <AutoFormElement layoutConstraint="colSpan:3"> |
| | | <Property name="name">noticeTagIn</Property> |
| | | <Property name="property">noticeTagIn</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <Label layoutConstraint="colSpan:3"/> |
| | | <Control/> |
| | | <AutoFormElement layoutConstraint="colSpan:3"> |
| | | <Property name="name">noticeTagOut</Property> |
| | | <Property name="property">noticeTagOut</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <Label layoutConstraint="colSpan:3"/> |
| | |
| | | package com.ld.igds.m.view; |
| | | |
| | | import com.bstek.bdf2.core.business.IUser; |
| | | import com.bstek.dorado.annotation.DataProvider; |
| | | import com.bstek.dorado.annotation.DataResolver; |
| | | import com.ld.igds.constant.Constant; |
| | |
| | | import com.ld.igds.m.service.InoutCommonService; |
| | | import com.ld.igds.models.DicTrigger; |
| | | import com.ld.igds.models.InoutSysConf; |
| | | import com.ld.igds.util.ContextUtil; |
| | | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * åºå
¥åºæµç¨é
ç½® |
| | |
| | | * @throws Exception |
| | | */ |
| | | @DataProvider |
| | | public InoutSysConf getSysConfData(Map<String, Object> param) { |
| | | List<InoutSysConf> list = inoutConfService.getSysConfData(param); |
| | | InoutSysConf inoutSysConf; |
| | | if (list.isEmpty()) { |
| | | inoutSysConf = new InoutSysConf(); |
| | | saveSysConfData(inoutSysConf); |
| | | } else { |
| | | inoutSysConf = list.get(0); |
| | | } |
| | | return inoutSysConf; |
| | | public InoutSysConf getSysConfData() { |
| | | IUser u = ContextUtil.getLoginUser(); |
| | | return inoutConfService.getSysConfData(u.getCompanyId(),ContextUtil.subDeptId(u)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @DataResolver |
| | | public String saveSysConfData(InoutSysConf data) { |
| | | |
| | | if(null == data.getDeptId()){ |
| | | data.setDeptId(ContextUtil.subDeptId(null)); |
| | | } |
| | | if(null == data.getCompanyId()){ |
| | | data.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | |
| | | inoutConfService.saveSysConfData(data); |
| | | |
| | | |
| | |
| | | import com.bstek.bdf2.core.model.DefaultCompany; |
| | | import com.bstek.dorado.annotation.Expose; |
| | | import com.ld.igds.common.CoreCommonService; |
| | | import com.ld.igds.constant.Constant; |
| | | import com.ld.igds.constant.DepotStatus; |
| | | import com.ld.igds.inout.InoutConstant; |
| | | import com.ld.igds.inout.dto.InoutData; |
| | |
| | | for (InoutSysConf inoutSysConf : inoutSysConfList) { |
| | | |
| | | // 夿å
¥åºéç¥åæ¯å¦å¯ç¨ |
| | | if (Constant.YN_Y.equals(inoutSysConf.getNoticeTagIn())) { |
| | | //æ´æ°å
¥åºéç¥å宿é |
| | | inoutCommonService.updateSumNoticeIn(inoutSysConf.getDeptId(), noticeInList); |
| | | } |
| | | |
| | | // 夿åºåºéç¥åæ¯å¦å¯ç¨ |
| | | if (Constant.YN_Y.equals(inoutSysConf.getNoticeTagOut())) { |
| | | //æ´æ°åºåºéç¥å宿é |
| | | inoutCommonService.updateSumNoticeOut(inoutSysConf.getDeptId(), noticeOutList); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | TYPE_ as type, |
| | | PROGRESS_ as progress, |
| | | RECORD_STATUS_ as recordStatus, |
| | | CUSTOMER_NAME_ as customerName, |
| | | INTEL_CARD_ as intelCard, |
| | | REGISTER_TIME_ as registerTime, |
| | | REGISTER_USER_ as registerUser, |
| | | USER_NAME_ as userName, |
| | | USER_CONTACT_ as userContact, |
| | | USER_ID_ as userId, |
| | | USER_BIRTHDAY_ as userBirthday, |
| | | USER_SEX_ as userSex, |
| | | USER_NATION_ as userNation, |
| | | USER_ID_ as userId, |
| | | USER_CONTACT_ as userContact, |
| | | USER_ADDRESS_ as userAddress, |
| | | CUR_STORAGE_ as curStorage, |
| | | INTEL_CARD_ as intelCard, |
| | | PLATE_NUM_ as plateNum, |
| | | TRANS_TYPE_ as transType, |
| | | SPEC_TYPE_ as specType, |
| | | CUSTOMER_ID_ as customerId, |
| | | CUSTOMER_NAME_ as customerName, |
| | | FOOD_VARIETY_ as foodVariety, |
| | | FOOD_TYPE_ as foodType, |
| | | FOOD_LEVEL_ as foodLevel, |
| | | FOOD_LOCATION_ID_ as foodLocationId, |
| | | FOOD_LOCATION_ as foodLocation, |
| | | FOOD_YEAR_ as foodYear, |
| | | CHECK_STATUS_ as checkStatus, |
| | | CHECK_USER_ as checkUser, |
| | | CHECK_TIME_ as checkTime, |
| | | SAMPLE_USER_ as sampleUser, |
| | | SAMPLE_TIME_ as sampleTime, |
| | | SAMPLE_TYPE_ as sampleType, |
| | | CHECK_ID_ as checkId, |
| | | IMPURITY_ as impurity, |
| | | WET_ as wet, |
| | | DE_IMPURITY_ as deImpurity, |
| | | DE_WET_ as deWet, |
| | | DE_HANDLE_ as deHandle, |
| | | DE_OTHER_ as deOther, |
| | | DE_SUM_ as deSum, |
| | | DE_CHECK_ as deCheck, |
| | | ADD_CHECK_ as addCheck, |
| | | jjlx as jjlx, |
| | | FULL_WEIGHT_ as fullWeight, |
| | | FULL_WEIGHT_TIME_ as fullWeightTime, |
| | | FULL_WEIGHT_USER_ as fullWeightUser, |
| | |
| | | EMPTY_WEIGHT_TIME_ as emptyWeightTime, |
| | | EMPTY_WEIGHT_USER_ as emptyWeightUser, |
| | | NET_WEIGHT_ as netWeight, |
| | | DE_HANDLE_ as deHandle, |
| | | DE_PACKAGE_ as dePackage, |
| | | DE_OTHER_ as deOther, |
| | | DE_OTHER_INTO_ as deOtherInfo, |
| | | SETTLE_WEIGHT_ as settleWeight, |
| | | RECORD_WEIGHT_ as recordWeight, |
| | | PRICE_ as price, |
| | | SETTLE_MONEY_ as settleMoney, |
| | | HANDLE_START_ as handleStart, |
| | | HANDLE_END_ as handleEnd, |
| | | SETTLE_ID_ as settleId, |
| | | HANDLE_USER_ as handleUser, |
| | | COMPLETE_TIME_ as completeTime, |
| | | COMPLETE_USER_ as completeUser, |
| | | REMARKS_ as remarks |
| | | REMARKS_ as remarks, |
| | | bzw as bzw, |
| | | dbz as dbz, |
| | | bzbjs as bzbjs |
| | | </sql> |
| | | |
| | | <!-- æ ¹æ®æ¡ä»¶æ¥è¯¢ï¼æ°æ®å¿
é¡»æ¯æµç¨ä¸çæ°æ® --> |
| | |
| | | </update> |
| | | |
| | | |
| | | <!-- ç»è®°æ¶åæå
¥å½ååºåçå¼curStorage ä¹åä¸åæ´æ¹ --> |
| | | <!-- æ°å¢æ°æ® --> |
| | | <insert id="insertData" parameterType="com.ld.igds.inout.dto.InoutData"> |
| | | insert into |
| | | D_INOUT_RECORD( |
| | |
| | | TYPE_, |
| | | PROGRESS_, |
| | | RECORD_STATUS_, |
| | | CUSTOMER_NAME_, |
| | | INTEL_CARD_, |
| | | REGISTER_TIME_, |
| | | REGISTER_USER_, |
| | | USER_NAME_, |
| | | USER_CONTACT_, |
| | | USER_ID_, |
| | | USER_BIRTHDAY_, |
| | | USER_SEX_, |
| | | USER_NATION_, |
| | | USER_ID_, |
| | | USER_CONTACT_, |
| | | USER_ADDRESS_, |
| | | CUR_STORAGE_, |
| | | INTEL_CARD_, |
| | | PLATE_NUM_, |
| | | TRANS_TYPE_, |
| | | SPEC_TYPE_, |
| | | CUSTOMER_ID_, |
| | | CUSTOMER_NAME_, |
| | | FOOD_VARIETY_, |
| | | FOOD_TYPE_, |
| | | FOOD_LEVEL_, |
| | | FOOD_LOCATION_ID_, |
| | | FOOD_LOCATION_, |
| | | FOOD_YEAR_, |
| | | CHECK_STATUS_, |
| | | CHECK_USER_, |
| | | CHECK_TIME_, |
| | | SAMPLE_USER_, |
| | | SAMPLE_TIME_, |
| | | SAMPLE_TYPE_, |
| | | CHECK_ID_, |
| | | IMPURITY_, |
| | | WET_, |
| | | DE_IMPURITY_, |
| | | DE_WET_, |
| | | DE_HANDLE_, |
| | | DE_OTHER_, |
| | | DE_SUM_, |
| | | DE_CHECK_, |
| | | ADD_CHECK_, |
| | | jjlx, |
| | | FULL_WEIGHT_, |
| | | FULL_WEIGHT_TIME_, |
| | | FULL_WEIGHT_USER_, |
| | |
| | | EMPTY_WEIGHT_TIME_, |
| | | EMPTY_WEIGHT_USER_, |
| | | NET_WEIGHT_, |
| | | DE_HANDLE_, |
| | | DE_PACKAGE_, |
| | | DE_OTHER_, |
| | | DE_OTHER_INTO_, |
| | | SETTLE_WEIGHT_, |
| | | RECORD_WEIGHT_, |
| | | PRICE_, |
| | | SETTLE_MONEY_, |
| | | HANDLE_START_, |
| | | HANDLE_END_, |
| | | SETTLE_ID_, |
| | | HANDLE_USER_, |
| | | COMPLETE_TIME_, |
| | | COMPLETE_USER_, |
| | | REMARKS_, |
| | | SETTLE_TAG_ |
| | | bzw, |
| | | dbz, |
| | | bzbjs, |
| | | UPDATE_TIME_ |
| | | ) |
| | | values |
| | | ( |
| | |
| | | #{data.type}, |
| | | #{data.progress}, |
| | | #{data.recordStatus}, |
| | | #{data.customerName}, |
| | | #{data.intelCard}, |
| | | #{data.registerTime}, |
| | | #{data.registerUser}, |
| | | #{data.userName}, |
| | | #{data.userContact}, |
| | | #{data.userId}, |
| | | #{data.userBirthday}, |
| | | #{data.userSex}, |
| | | #{data.userNation}, |
| | | #{data.userId}, |
| | | #{data.userContact}, |
| | | #{data.userAddress}, |
| | | #{data.curStorage}, |
| | | #{data.intelCard}, |
| | | #{data.plateNum}, |
| | | #{data.transType}, |
| | | #{data.specType}, |
| | | #{data.customerId}, |
| | | #{data.customerName}, |
| | | #{data.foodVariety}, |
| | | #{data.foodType}, |
| | | #{data.foodLevel}, |
| | | #{data.foodLocationId}, |
| | | #{data.foodLocation}, |
| | | #{data.foodYear}, |
| | | #{data.checkStatus}, |
| | | #{data.checkUser}, |
| | | #{data.checkTime}, |
| | | #{data.sampleUser}, |
| | | #{data.sampleTime}, |
| | | #{data.sampleType}, |
| | | #{data.checkId}, |
| | | #{data.impurity}, |
| | | #{data.wet}, |
| | | #{data.deImpurity}, |
| | | #{data.deWet}, |
| | | #{data.deHandle}, |
| | | #{data.deOther}, |
| | | #{data.deSum}, |
| | | #{data.deCheck}, |
| | | #{data.addCheck}, |
| | | #{data.jjlx}, |
| | | #{data.fullWeight}, |
| | | #{data.fullWeightTime}, |
| | | #{data.fullWeightUser}, |
| | |
| | | #{data.emptyWeightTime}, |
| | | #{data.emptyWeightUser}, |
| | | #{data.netWeight}, |
| | | #{data.deHandle}, |
| | | #{data.dePackage}, |
| | | #{data.deOther}, |
| | | #{data.deOtherInfo}, |
| | | #{data.settleWeight}, |
| | | #{data.recordWeight}, |
| | | #{data.price}, |
| | | #{data.settleMoney}, |
| | | #{data.handleStart}, |
| | | #{data.handleEnd}, |
| | | #{data.settleId}, |
| | | #{data.handleUser}, |
| | | #{data.completeTime}, |
| | | #{data.completeUser}, |
| | | #{data.remarks}, |
| | | #{data.settleTag} |
| | | #{data.bzw}, |
| | | #{data.dbz}, |
| | | #{data.bzbjs}, |
| | | #{data.updateTime} |
| | | ) |
| | | </insert> |
| | | |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <!--æ ¹æ®è½¦çåå¡å·éªè¯æ¯å¦æéå¤ä¿¡æ¯--> |
| | | <select id="checkExist" parameterType="com.ld.igds.inout.dto.InoutParam"> |
| | | select count(1) |
| | | from |
| | | D_INOUT_RECORD |
| | | WHERE COMPANY_ID_ = #{param.companyId} |
| | | AND TYPE_ = #{param.type} |
| | | AND (PLATE_NUM_ = #{param.plateNum} or INTEL_CARD_ = #{param.intelCard}) |
| | | AND PROGRESS_ != 'RECORD' |
| | | AND RECORD_STATUS_ != 'ERROR' |
| | | AND RECORD_STATUS_ != 'DEL' |
| | | <if test="param.start != null"> |
| | | AND REGISTER_TIME_ <![CDATA[ > ]]> #{param.start} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | layer.close(index); |
| | | var data = json.content; |
| | | if (data === "not found") { |
| | | layer.alert("没æè·åå°èº«ä»½è¯ä¿¡æ¯ï¼", { |
| | | offset: ['300px', '300px'] |
| | | }); |
| | | alertError("没æè·åå°èº«ä»½è¯ä¿¡æ¯ï¼"); |
| | | return; |
| | | } |
| | | // 临æ¶èµå¼ |
| | |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.alert("身份è¯è¯»å失败ï¼", { |
| | | offset: ['300px', '300px'] |
| | | }); |
| | | layer.close(index); |
| | | alertError("身份è¯è¯»å失败ï¼"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //ä½¿ç¨æä»¶è¯»åæºæ
§å¡å· |
| | | function flushICCard() { |
| | | var index = layer.load(); |
| | | $("#intelCard").val(null); |
| | | $.ajax({ |
| | | type: "GET", |
| | |
| | | jsonp: "callback", |
| | | jsonpCallback: "jsonpCallback", |
| | | success: function (json) { |
| | | layer.close(index); |
| | | //console.log(json); |
| | | var data = json.no; |
| | | //console.log(data); |
| | | if (data === "not found") { |
| | | layer.alert("è¯·éæ°è¯»å¡ï¼", {offset: ['300px', '300px']}); |
| | | alertError("è¯·éæ°è¯»å¡ï¼"); |
| | | } else { |
| | | $("#intelCard").val(data); |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.alert("ICå¡è¯»ååºéï¼", {offset: ['300px', '300px']}); |
| | | layer.close(index); |
| | | alertError("ICå¡è¯»ååºéï¼"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //读å车çå· |
| | | function flushPlateNum() { |
| | | function getPlateNum() { |
| | | var index = layer.load(); |
| | | $.ajax({ |
| | | type: "POST", |
| | |
| | | data: JSON.stringify(lprDto), |
| | | success: function (result) { |
| | | if (result.code != "0000") { |
| | | layer.alert(result.msg, { |
| | | offset: ['300px', '300px'] |
| | | }); |
| | | } else { |
| | | if (result.data.errorMsg) { |
| | | layer.alert(result.data.errorMsg, { |
| | | offset: ['300px', '300px'] |
| | | }); |
| | | alertError(result.msg); |
| | | } else { |
| | | $("#plateNum").val(result.data.plateNum); |
| | | $("#plateNum2").val(result.data.plateNum); |
| | | } |
| | | } |
| | | layer.close(index); |
| | | }, |
| | | error: function () { |
| | | layer.close(index); |
| | | layer.alert("车çè¯å«å¤±è´¥ï¼", { |
| | | offset: ['300px', '300px'] |
| | | }); |
| | | alertError("车çè¯å«å¤±è´¥ï¼"); |
| | | } |
| | | }); |
| | | } |
| | |
| | | function submit() { |
| | | var data = form.val("form-data"); |
| | | if (!data.userName) { |
| | | notify("æ¿è¿äººä¿¡æ¯ä¸è½ä¸ºç©º", null); |
| | | alertError("æ¿è¿äººä¿¡æ¯ä¸è½ä¸ºç©º"); |
| | | return; |
| | | } |
| | | if (!data.plateNum) { |
| | | notify("车çå·ä¸è½ä¸ºç©º", null); |
| | | alertError("车çå·ä¸è½ä¸ºç©º"); |
| | | return; |
| | | } |
| | | if (!data.userId) { |
| | | notify("身份è¯å·ä¸è½ä¸ºç©º", null); |
| | | alertError("身份è¯å·ä¸è½ä¸ºç©º"); |
| | | return; |
| | | } |
| | | |
| | |
| | | data: JSON.stringify(snapData), |
| | | success: function (result) { |
| | | if (result.code != "0000") { |
| | | layer.alert(result.msg); |
| | | alertError(result.msg); |
| | | submitData(data); |
| | | } else { |
| | | snapData = result.data; |
| | | |
| | | $("#pz-img").addClass("kccz-r-img-red"); |
| | | $("#pz-text").text("å·²æç
§"); |
| | | |
| | | submitData(data); |
| | | } |
| | | }, |
| | |
| | | //æ§è¡ä¿åæ°æ® |
| | | function submitData(data) { |
| | | var index = layer.load(); |
| | | |
| | | var files = [{ |
| | | fileName: snapData.fileName1 |
| | | }]; |
| | | data.files = files; |
| | | |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "../../basic/inout/inout-next-step", |
| | | url: "../../basic/inout/submit-register", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: JSON.stringify(data), |
| | | success: function (result) { |
| | | layer.close(index); |
| | | if (result.code != "0000") { |
| | | notify(result.msg, result.data); |
| | | notifyProgress(result.msg, result.data); |
| | | } else { |
| | | notify("æ°æ®æäº¤æå", result.data); |
| | | // éç½®é¡µé¢ |
| | | notifyProgress("æ°æ®æäº¤æå", result.data); |
| | | resetForm(); |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.close(index); |
| | | layer.alert("æäº¤å¤±è´¥ï¼è¯·éæ°å°è¯ï¼ï¼"); |
| | | alertError("æäº¤å¤±è´¥ï¼è¯·éæ°å°è¯ï¼ï¼"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * å¼¹åºæéæ¡ |
| | | * @param msg æéä¿¡æ¯ |
| | | * @param data æ°æ®ä¿¡æ¯ï¼å¯è½ä¸ºç©º |
| | | */ |
| | | function notify(msg, data) { |
| | | if (data) { |
| | | //èµå¼ |
| | | $("#resultMsg").text(msg); |
| | | $("#resultUserName").text(data.userName); |
| | | $("#resultPlateNum").text(data.plateNum); |
| | | if ("IN" == data.type) { |
| | | $("#resultType").text("å
¥åº-" + INOUT_PROGRESS_MSG(data.progress)); |
| | | } else { |
| | | $("#resultType").text("åºåº-" + INOUT_PROGRESS_MSG(data.progress)); |
| | | } |
| | | $("#resultIntelCard").text(data.intelCard); |
| | | |
| | | layer.open({ |
| | | type: 1, |
| | | offset: ['150px', '200px'], |
| | | area: '450px;', |
| | | shade: 0.8, |
| | | id: 'dialog_notify_info', |
| | | btn: ['ç¡®å®'], |
| | | content: $('#dialog-from-notify'), |
| | | yes: function (index) { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } else { |
| | | layer.alert(msg, {offset: ['300px', '300px']}); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | //å½åèç¹ å
¥åºç»è®° |
| | | var layer; |
| | | var form; |
| | | var snapData;//ç»è®°ç
§ç |
| | | |
| | | $(function () { |
| | | layui.use(['layer', 'laydate', 'form', 'util'], function () { |
| | | var util = layui.util; |
| | | var laydate = layui.laydate; |
| | | layer = layui.layer; |
| | | form = layui.form; |
| | | laydate.render({ |
| | | elem: '#userBirthday' |
| | | }); |
| | | |
| | | // å³ä¸è§æ·»å åºå®ä¿¡æ¯ |
| | | util.fixbar({ |
| | | bar1: true, |
| | | css: { |
| | | right: 10, |
| | | bottom: 20 |
| | | }, |
| | | bgcolor: '#53adce', |
| | | click: function (type) { |
| | | if (type === 'bar1') { |
| | | layer.closeAll(); |
| | | layer.open({ |
| | | type: 2, |
| | | title: false, |
| | | shadeClose: true, |
| | | shade: 0.3, |
| | | closeBtn: 2, |
| | | offset: ['50px','50px'], |
| | | area: ['1000px', '640px'], |
| | | content: '../../basic/inout/inout-progress?type=' + type + "&t=" + Math.random() |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | //æ¾ç¤ºå
¥åºæµç¨ |
| | | showProgress(); |
| | | |
| | | var rightH = $(".rkbk-left-wrap").height(); |
| | | $(".rkbk-right-wrap").height(rightH); |
| | | |
| | | $(window).resize(function () { |
| | | var rightH = $(".rkbk-left-wrap").height(); |
| | | $(".rkbk-right-wrap").height(rightH); |
| | | }); |
| | | |
| | | // åå§åWebSocket |
| | | initInoutWS(deptId, bizType, progress, userId); |
| | | }); |
| | | |
| | | window.onload = function () { |
| | | // å è½½è§é¢ |
| | | initVideo(lprDto, null, null); |
| | | }; |
| | | |
| | | //æ§å¶æµç¨ç¯èæ¾ç¤º |
| | | function showProgress() { |
| | | if (!inoutProgress) { |
| | | return; |
| | | } |
| | | if (inoutProgress.indexOf("REGISTER") == -1) { |
| | | $("#progress-register").css("display", "none"); |
| | | } |
| | | if (inoutProgress.indexOf("CHECK") == -1) { |
| | | $("#progress-check").css("display", "none"); |
| | | } |
| | | if (inoutProgress.indexOf("WEIGHT_FULL") == -1) { |
| | | $("#progress-fullWeight").css("display", "none"); |
| | | } |
| | | if (inoutProgress.indexOf("HANDLE") == -1) { |
| | | $("#progress-hand").css("display", "none"); |
| | | } |
| | | if (inoutProgress.indexOf("WEIGHT_EMPTY") == -1) { |
| | | $("#progress-emptyWeight").css("display", "none"); |
| | | } |
| | | if (inoutProgress.indexOf("CARD_BACK") == -1) { |
| | | $("#progress-cardBack").css("display", "none"); |
| | | } |
| | | } |
| | | |
| | | // socketä¿¡æ¯è¿åèç |
| | | function socketOnMessage(packet) { |
| | | |
| | | } |
| | | |
| | | //ä½¿ç¨æä»¶è¯»åèº«ä»½è¯ |
| | | function flushIdCard() { |
| | | var index = layer.load(); |
| | | $.ajax({ |
| | | type: "GET", |
| | | async: true, |
| | | url: "http://127.0.0.1:9111/IDCARD", |
| | | data: {}, |
| | | dataType: "jsonp", |
| | | jsonp: "callback", |
| | | jsonpCallback: "jsonpCallback", |
| | | success: function (json) { |
| | | layer.close(index); |
| | | var data = json.content; |
| | | if (data === "not found") { |
| | | layer.alert("没æè·åå°èº«ä»½è¯ä¿¡æ¯ï¼", { |
| | | offset: ['300px', '300px'] |
| | | }); |
| | | return; |
| | | } |
| | | // 临æ¶èµå¼ |
| | | $("#userName").val(data.cnName); |
| | | $("#userSex").val(data.sex); |
| | | $("#userNation").val(data.nation); |
| | | $("#userAddress").val(data.address); |
| | | //$("#id_img_pers").attr("src",data.Image); |
| | | var time = data.birthdate; |
| | | if (time.length == 8) { |
| | | time = time.substring(0, 4) + "-" + time.substring(4, 6) + "-" + time.substring(6); |
| | | } |
| | | $("#userBirthday").val(time); |
| | | $("#userId").val(data.idNum); |
| | | if (data.Image) { |
| | | $("#id_img_pers").attr("src", data.Image); |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.alert("身份è¯è¯»å失败ï¼", { |
| | | offset: ['300px', '300px'] |
| | | }); |
| | | layer.close(index); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //ä½¿ç¨æä»¶è¯»åæºæ
§å¡å· |
| | | function flushICCard() { |
| | | $("#intelCard").val(null); |
| | | $.ajax({ |
| | | type: "GET", |
| | | async: true, |
| | | url: "http://127.0.0.1:9111/ICCARD", |
| | | data: {}, |
| | | dataType: "jsonp", |
| | | jsonp: "callback", |
| | | jsonpCallback: "jsonpCallback", |
| | | success: function (json) { |
| | | //console.log(json); |
| | | var data = json.no; |
| | | //console.log(data); |
| | | if (data === "not found") { |
| | | layer.alert("è¯·éæ°è¯»å¡ï¼", {offset: ['300px', '300px']}); |
| | | } else { |
| | | $("#intelCard").val(data); |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.alert("ICå¡è¯»ååºéï¼", {offset: ['300px', '300px']}); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //读å车çå· |
| | | function flushPlateNum() { |
| | | var param = JSON.stringify(lprDto); |
| | | var index = layer.load(); |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "../../inout/api/flush-lpr", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: param, |
| | | success: function (result) { |
| | | if (result.code != "0000") { |
| | | layer.alert(result.msg, { |
| | | offset: ['300px', '300px'] |
| | | }); |
| | | } else { |
| | | if (result.data.errorMsg) { |
| | | layer.alert(result.data.errorMsg, { |
| | | offset: ['300px', '300px'] |
| | | }); |
| | | } else { |
| | | $("#plateNum").val(result.data.plateNum); |
| | | } |
| | | } |
| | | layer.close(index); |
| | | }, |
| | | error: function () { |
| | | layer.close(index); |
| | | layer.alert("车çè¯å«å¤±è´¥ï¼", { |
| | | offset: ['300px', '300px'] |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //é置车çè¯å«ä¿¡æ¯ |
| | | function resetPlateNum() { |
| | | var index = layer.load(); |
| | | var param = JSON.stringify(lprDto); |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "../../inout/api/reset-lpr", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: param, |
| | | success: function (result) { |
| | | if (result.code != "0000") { |
| | | layer.alert(result.msg, { |
| | | offset: ['300px', '300px'] |
| | | }); |
| | | } else { |
| | | layer.alert("éç½®æåï¼è¯·éæ°è·å车çä¿¡æ¯", { |
| | | offset: ['300px', '300px'] |
| | | }); |
| | | } |
| | | layer.close(index); |
| | | }, |
| | | error: function () { |
| | | layer.close(index); |
| | | layer.alert("éç½®æ§è¡å¤±è´¥", { |
| | | offset: ['300px', '300px'] |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // è¡¨åæ¸
空 |
| | | function resetForm() { |
| | | $("#form-data")[0].reset(); |
| | | form.render(); |
| | | // 身份è¯éç½® |
| | | $("#id_img_pers").attr("src", "../../static/images/rkbk-photo_03.png"); |
| | | $("#pz-img").removeClass("kccz-r-img-red"); |
| | | $("#pz-text").text("èªå¨ææ"); |
| | | } |
| | | |
| | | // å½å宿 |
| | | function submit() { |
| | | var data = form.val("form-data"); |
| | | if (!data.userName) { |
| | | notify("æ¿è¿äººä¿¡æ¯ä¸è½ä¸ºç©º", null); |
| | | return; |
| | | } |
| | | if (!data.plateNum) { |
| | | notify("车çå·ä¸è½ä¸ºç©º", null); |
| | | return; |
| | | } |
| | | if (!data.intelCard && !data.userId) { |
| | | notify("æºæ
§å¡å·ä¸èº«ä»½è¯å·ä¸è½åæ¶ä¸ºç©º", null); |
| | | return; |
| | | } |
| | | |
| | | //ç³»ç»ææ |
| | | layer.msg("ç³»ç»èªå¨ææè®°å½â¦â¦"); |
| | | snapData = { |
| | | companyId: companyId, |
| | | deptId: deptId, |
| | | progress: progress, |
| | | bizType: bizType, |
| | | plateNum: data.plateNum, |
| | | id1: (null != lprDto) ? lprDto.id : null |
| | | }; |
| | | |
| | | $.ajax({ |
| | | sync: false, |
| | | type: "POST", |
| | | url: "../../inout/api/snap-img", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: JSON.stringify(snapData), |
| | | success: function (result) { |
| | | if (result.code != "0000") { |
| | | layer.alert(result.msg); |
| | | submitData(data); |
| | | } else { |
| | | snapData = result.data; |
| | | |
| | | $("#pz-img").addClass("kccz-r-img-red"); |
| | | $("#pz-text").text("å·²æç
§"); |
| | | |
| | | submitData(data); |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.msg("åå°è°ç¨æªå¾å¤±è´¥ï¼è¯·éæ°å°è¯ï¼ï¼"); |
| | | submitData(data); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //æ§è¡ä¿åæ°æ® |
| | | function submitData(data) { |
| | | var index = layer.load(); |
| | | |
| | | var files = [{ |
| | | fileName: snapData.fileName1 |
| | | }]; |
| | | data.files = files; |
| | | |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "../../basic/inout/inout-next-step", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: JSON.stringify(data), |
| | | success: function (result) { |
| | | layer.close(index); |
| | | if (result.code != "0000") { |
| | | notify(result.msg, result.data); |
| | | } else { |
| | | notify("æ°æ®æäº¤æå", result.data); |
| | | // éç½®é¡µé¢ |
| | | resetForm(); |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.close(index); |
| | | layer.alert("æäº¤å¤±è´¥ï¼è¯·éæ°å°è¯ï¼ï¼"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * å¼¹åºæéæ¡ |
| | | * @param msg æéä¿¡æ¯ |
| | | * @param data æ°æ®ä¿¡æ¯ï¼å¯è½ä¸ºç©º |
| | | */ |
| | | function notify(msg, data) { |
| | | if (data) { |
| | | //èµå¼ |
| | | $("#resultMsg").text(msg); |
| | | $("#resultUserName").text(data.userName); |
| | | $("#resultPlateNum").text(data.plateNum); |
| | | if ("IN" == data.type) { |
| | | $("#resultType").text("å
¥åº-" + INOUT_PROGRESS_MSG(data.progress)); |
| | | } else { |
| | | $("#resultType").text("åºåº-" + INOUT_PROGRESS_MSG(data.progress)); |
| | | } |
| | | $("#resultIntelCard").text(data.intelCard); |
| | | |
| | | layer.open({ |
| | | type: 1, |
| | | offset: ['150px', '200px'], |
| | | area: '450px;', |
| | | shade: 0.8, |
| | | id: 'dialog_notify_info', |
| | | btn: ['ç¡®å®'], |
| | | content: $('#dialog-from-notify'), |
| | | yes: function (index) { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } else { |
| | | layer.alert(msg, {offset: ['300px', '300px']}); |
| | | } |
| | | } |
| | |
| | | $("#progress-cardBack").css("display", "none"); |
| | | } |
| | | } |
| | | |
| | | //é误æé |
| | | function alertError(msg) { |
| | | layer.alert(msg, { |
| | | icon: 5, |
| | | offset: ['300px', '300px'] |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * å¼¹åºæéæ¡ |
| | | * @param msg æéä¿¡æ¯ |
| | | * @param data æ°æ®ä¿¡æ¯ï¼å¯è½ä¸ºç©º |
| | | */ |
| | | function notifyProgress(msg, data) { |
| | | if (data) { |
| | | //èµå¼ |
| | | $("#resultMsg").text(msg); |
| | | $("#resultUserName").text(data.userName); |
| | | $("#resultPlateNum").text(data.plateNum); |
| | | if ("IN" == data.type) { |
| | | $("#resultType").text("å
¥åº-" + INOUT_PROGRESS_MSG(data.progress)); |
| | | } else { |
| | | $("#resultType").text("åºåº-" + INOUT_PROGRESS_MSG(data.progress)); |
| | | } |
| | | $("#resultIntelCard").text(data.intelCard); |
| | | layer.open({ |
| | | type: 1, |
| | | offset: ['150px', '200px'], |
| | | area: '450px;', |
| | | shade: 0.8, |
| | | id: 'dialog_notify_info', |
| | | btn: ['ç¡®å®'], |
| | | content: $('#dialog-from-notify'), |
| | | yes: function (index) { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } else { |
| | | layer.alert(msg, {offset: ['300px', '300px']}); |
| | | } |
| | | } |
| | |
| | | <div class="layui-form-item"> |
| | | <input type="button" value="读车ç" |
| | | class="rkbk-r-btn fr layui-btn layui-btn-normal" |
| | | onclick="flushPlateNum()" /> <label |
| | | onclick="getPlateNum()" /> <label |
| | | class="layui-form-label color-red">è¿è¾è½¦çï¼</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="plateNum" id="plateNum" |