17个文件已修改
2个文件已添加
17个文件已删除
| | |
| | | @PostMapping("/pakout/execute/auth/v1") |
| | | @AppAuth(memo = "添加订单出库") |
| | | public synchronized R pakoutOrderCreate(@RequestHeader(required = false) String appkey, |
| | | @RequestBody OpenOrderPakoutParam param, |
| | | @RequestBody OpenOrderPakinParam param, |
| | | HttpServletRequest request) { |
| | | auth(appkey, param, request); |
| | | if (Cools.isEmpty(param)) { |
| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.DocType; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.param.OpenOrderPakinParam; |
| | | import com.zy.asrs.service.DocTypeService; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class OrderDetlController extends BaseController { |
| | | |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private OrderService orderService; |
| | | |
| | | @Autowired |
| | | private DocTypeService docTypeService; |
| | | |
| | | @RequestMapping(value = "/orderDetl/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} else { |
| | | wrapper.orderBy("create_time", false); |
| | | } |
| | | wrapper.eq("status", 1); |
| | | // wrapper.eq("status", 1); |
| | | Page<OrderDetl> orderDetlPage = orderDetlService.selectPage(new Page<>(curr, limit), wrapper); |
| | | return R.ok(orderDetlPage); |
| | | } |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 订单明细手动上报 |
| | | * @param ids 订单明细id |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/orderDetl/manualReporting/auth") |
| | | @ManagerAuth |
| | | public R manualReporting(@RequestParam(value="ids[]") Long[] ids){ |
| | | R r = R.ok(); |
| | | for (Long id : ids){ |
| | | OrderDetl orderDetl = orderDetlService.selectById(id); |
| | | if(orderDetl.getAnfme().equals(orderDetl.getWorkQty())){ |
| | | return R.error("物料编号={"+orderDetl.getMatnr()+"}完成数量和作业数量不相同无法手动上报"); |
| | | } |
| | | if(!Cools.isEmpty(orderDetl.getUnits())&&orderDetl.getUnits().equals(orderDetl.getAnfme())){ |
| | | r= R.error("上报数量和完成数量一致禁止上报"); |
| | | } |
| | | r = orderDetlService.U8Reporting(id, 1); |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | /** |
| | | * 订单明细关闭 |
| | | * @param ids 订单明细id |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/orderDetl/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | R r = R.ok(); |
| | | for (Long id : ids){ |
| | | orderDetlService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | OrderDetl orderDetl = orderDetlService.selectById(id); |
| | | if(orderDetl.getAnfme().equals(orderDetl.getWorkQty())){ |
| | | return R.error("物料编号={"+orderDetl.getMatnr()+"}完成数量和作业数量不相同无法关闭"); |
| | | } |
| | | r = orderDetlService.U8Reporting(id, 0); |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | /** |
| | | * 订单明细启用 |
| | | * @param ids 订单明细id |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/orderDetl/enable/auth") |
| | | @ManagerAuth |
| | | public R enable(@RequestParam(value="ids[]") Long[] ids){ |
| | | R r = R.ok(); |
| | | for (Long id : ids){ |
| | | // OrderDetl orderDetl = orderDetlService.selectById(id); |
| | | // if(orderDetl.getAnfme().equals(orderDetl.getWorkQty())){ |
| | | // return R.error("物料编号={"+orderDetl.getMatnr()+"}完成数量和作业数量不相同无法启用"); |
| | | // } |
| | | r = orderDetlService.U8Reporting(id, 1); |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/orderDetl/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | |
| | | private Date sendTime; |
| | | |
| | | /** |
| | | * 物流名称 |
| | | * 目标仓库 |
| | | */ |
| | | @ApiModelProperty(value= "物流名称") |
| | | @ApiModelProperty(value= "目标仓库") |
| | | @TableField("ship_name") |
| | | private String shipName; |
| | | |
| | | /** |
| | | * 物流单号 |
| | | * 源仓库 |
| | | */ |
| | | @ApiModelProperty(value= "物流单号") |
| | | @ApiModelProperty(value= "源仓库") |
| | | @TableField("ship_code") |
| | | private String shipCode; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.DocTypeService; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.common.utils.Synchro; |
| | | import com.zy.system.entity.User; |
| | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Objects; |
| | | |
| | | @Data |
| | | @TableName("man_order_detl") |
| | |
| | | private String sku; |
| | | |
| | | /** |
| | | * 单位量 |
| | | * 上报数量 |
| | | */ |
| | | @ApiModelProperty(value= "单位量") |
| | | @ApiModelProperty(value= "上报数量") |
| | | private Double units; |
| | | |
| | | /** |
| | |
| | | private Integer source; |
| | | |
| | | /** |
| | | * 要求检验 1: 是 0: 否 |
| | | * 是否上报 1: 是 0: 否 2: 等待上报 |
| | | */ |
| | | @ApiModelProperty(value= "要求检验 1: 是 0: 否 ") |
| | | @ApiModelProperty(value= "是否上报 1: 是 0: 否 2: 等待上报") |
| | | private Integer inspect; |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | public String getDanger$(){ |
| | | if (null == this.danger){ return null; } |
| | | switch (this.danger){ |
| | | case 1: |
| | | return "是"; |
| | | case 0: |
| | | return "否"; |
| | | default: |
| | | return String.valueOf(this.danger); |
| | | } |
| | | } |
| | | |
| | | public String getStatus$(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | |
| | | Synchro.Copy(source, this); |
| | | } |
| | | |
| | | public String getAnfme$(){ |
| | | if(Objects.equals(this.qty, this.anfme)){ |
| | | return "已完成"; |
| | | }else if(this.workQty==0){ |
| | | return "待处理"; |
| | | }else if(this.anfme>this.qty){ |
| | | return "作业中"; |
| | | }else if(this.anfme<this.qty){ |
| | | return "异常"; |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | public String getDanger$(){ |
| | | DocTypeService service = SpringUtils.getBean(DocTypeService.class); |
| | | OrderService orderServicer=SpringUtils.getBean(OrderService.class); |
| | | Order order = orderServicer.selectByNo(this.orderNo); |
| | | DocType docType = service.selectById(order.getDocType()); |
| | | if (!Cools.isEmpty(docType)){ |
| | | return String.valueOf(docType.getDocName()); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | private String color; |
| | | |
| | | /** |
| | | * 品牌 |
| | | * 通用 |
| | | */ |
| | | private String brand; |
| | | |
| | |
| | | private Integer source; |
| | | |
| | | /** |
| | | * 要求检验 1: 是 0: 否 |
| | | * 是否启用 1: 是 0: 否 |
| | | */ |
| | | private Integer inspect; |
| | | |
| | |
| | | * 数量 |
| | | */ |
| | | private Double anfme; |
| | | |
| | | /** |
| | | * 启用时间 |
| | | */ |
| | | @ApiModelProperty(value= "启用时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date suspensionDate; |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | @Data |
| | | public class OpenOrderPakinParam { |
| | | private String billType; |
| | | |
| | | private String orderNo; |
| | | |
| | | private String orderType; |
| | | |
| | | private String billType; |
| | | |
| | | private String orderTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 目标仓库 |
| | | */ |
| | | private String targetWarehouse; |
| | | |
| | | /** |
| | | * 源仓库 |
| | | */ |
| | | private String sourceWarehouse; |
| | | |
| | | private List<DetlDto> matList; |
| | | |
New file |
| | |
| | | package com.zy.asrs.entity.result; |
| | | |
| | | import com.zy.asrs.entity.param.OpenOrderPakinParam; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class OrderRsult { |
| | | public OrderRsult.Login login; |
| | | public String vouchName; |
| | | public String commandType; |
| | | public String verifier; |
| | | public List<OrderRsult.HeadTable> headTable; |
| | | public List<OrderRsult.BodyTable> bodyTable; |
| | | |
| | | @Data |
| | | public static class Login { |
| | | public String sAccID; |
| | | public String sUserID; |
| | | public String sPassword; |
| | | public String sServer; |
| | | } |
| | | |
| | | @Data |
| | | public static class HeadTable { |
| | | public String ctvcode; |
| | | public String dtvdate; |
| | | public String cmaker; |
| | | public String vt_id; |
| | | public String ciwhcode; |
| | | public String cowhcode; |
| | | public String cordcode; |
| | | public String cirdcode; |
| | | public String codepcode; |
| | | public String cidepcode; |
| | | } |
| | | |
| | | @Data |
| | | public static class BodyTable { |
| | | public String irowno; |
| | | public String cinvcode; |
| | | public String ctvbatch; |
| | | public String itvquantity; |
| | | public String cinposcode; |
| | | public String coutposcode; |
| | | public String itrsid; |
| | | public String editprop; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 添加入库单 |
| | | */ |
| | | void pakoutOrderCreate(OpenOrderPakoutParam param); |
| | | void pakoutOrderCreate(OpenOrderPakinParam param); |
| | | |
| | | /** |
| | | * 入库单回写 |
| | |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | |
| | | import java.util.List; |
| | |
| | | * @return |
| | | */ |
| | | boolean increaseWorkQty(Long orderId, String matnr, String batch, Double workQty); |
| | | |
| | | R U8Reporting(long id,Integer sts); |
| | | |
| | | } |
| | |
| | | import com.zy.asrs.mapper.CheckDetlMapper; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.CheckDetlService; |
| | | import com.zy.asrs.task.kingdee.handler.LoginAuthenticationHandler; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import javafx.print.Printer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | @Service |
| | | @Slf4j |
| | | public class CheckDetlServiceImpl extends ServiceImpl<CheckDetlMapper, CheckDetl> implements CheckDetlService { |
| | | @Value("${erp.newaddress.UPLOADURL}") |
| | | @Value("${erp.address.URL}") |
| | | //端口 |
| | | private String URL; |
| | | @Value("${erp.newaddress.uploadaddressSubmit}") |
| | | @Value("${erp.address.outaddressSave}") |
| | | private String uploadAddress; |
| | | @Autowired |
| | | private CheckDetlService checkDetlService; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | |
| | | @Autowired |
| | | private LoginAuthenticationHandler loginAuthenticationHandler; |
| | | |
| | | |
| | | @Override |
| | |
| | | null, // 邮费 |
| | | null, // 付款时间 |
| | | null, // 发货时间 |
| | | null, // 物流名称 |
| | | null, // 物流单号 |
| | | param.getTargetWarehouse(), // 目标仓库 |
| | | param.getSourceWarehouse(), // 源仓库 |
| | | 1L, // 订单状态 |
| | | 1, // 状态 |
| | | 9527L, // 添加人员 |
| | |
| | | throw new CoolException("生成单据主档失败,请联系管理员"); |
| | | } |
| | | // 单据明细档 |
| | | List<DetlDto> list = new ArrayList<>(); |
| | | List<DetlDto> orderDetails = param.getMatList(); |
| | | for (DetlDto detail : orderDetails) { |
| | | DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getAnfme()); |
| | | if (DetlDto.has(list, dto)) { |
| | | DetlDto detlDto = DetlDto.find(list, dto.getMatnr(), dto.getBatch()); |
| | | assert detlDto != null; |
| | | detlDto.setAnfme(detlDto.getAnfme() + detail.getAnfme()); |
| | | } else { |
| | | list.add(dto); |
| | | } |
| | | } |
| | | for (DetlDto detlDto : list) { |
| | | // List<DetlDto> list = new ArrayList<>(); |
| | | // List<DetlDto> orderDetails = param.getMatList(); |
| | | // for (DetlDto detail : orderDetails) { |
| | | // DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getAnfme()); |
| | | // if (DetlDto.has(list, dto)) { |
| | | // DetlDto detlDto = DetlDto.find(list, dto.getMatnr(), dto.getBatch()); |
| | | // assert detlDto != null; |
| | | // detlDto.setAnfme(detlDto.getAnfme() + detail.getAnfme()); |
| | | // } else { |
| | | // list.add(dto); |
| | | // } |
| | | // } |
| | | for (DetlDto detlDto : param.getMatList()) { |
| | | Mat mat = matService.selectByMatnr(detlDto.getMatnr()); |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException(detlDto.getMatnr() + "编号商品检索失败,请先添加商品"); |
| | |
| | | orderDetl.setUpdateTime(now); |
| | | orderDetl.setStatus(1); |
| | | orderDetl.setQty(0.0D); |
| | | orderDetl.setWorkQty(0.0D); |
| | | orderDetl.setUnits(0.0); |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | | } |
| | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void pakoutOrderCreate(OpenOrderPakoutParam param) { |
| | | public void pakoutOrderCreate(OpenOrderPakinParam param) { |
| | | Order order = orderService.selectByNo(param.getOrderNo()); |
| | | // 如果单据不存在则添加;如果单据存在,作业中无法修改,反之则修改单据 |
| | | if (!Cools.isEmpty(order)) { |
| | |
| | | null, // 邮费 |
| | | null, // 付款时间 |
| | | null, // 发货时间 |
| | | null, // 物流名称 |
| | | null, // 物流单号 |
| | | param.getTargetWarehouse(), // 物流名称 |
| | | param.getSourceWarehouse(), // 物流单号 |
| | | 1L, // 订单状态 |
| | | 1, // 状态 |
| | | 9527L, // 添加人员 |
| | |
| | | throw new CoolException("生成单据主档失败,请联系管理员"); |
| | | } |
| | | // 单据明细档 |
| | | List<DetlDto> list = new ArrayList<>(); |
| | | List<DetlDto> orderDetails = param.getMatList(); |
| | | for (DetlDto detail : orderDetails) { |
| | | DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getAnfme()); |
| | | if (DetlDto.has(list, dto)) { |
| | | DetlDto detlDto = DetlDto.find(list, dto.getMatnr(), dto.getBatch()); |
| | | assert detlDto != null; |
| | | detlDto.setAnfme(detlDto.getAnfme() + detail.getAnfme()); |
| | | } else { |
| | | list.add(dto); |
| | | } |
| | | } |
| | | for (DetlDto detlDto : list) { |
| | | // List<DetlDto> list = new ArrayList<>(); |
| | | // List<DetlDto> orderDetails = param.getMatList(); |
| | | // for (DetlDto detail : orderDetails) { |
| | | // DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getAnfme()); |
| | | // if (DetlDto.has(list, dto)) { |
| | | // DetlDto detlDto = DetlDto.find(list, dto.getMatnr(), dto.getBatch()); |
| | | // assert detlDto != null; |
| | | // detlDto.setAnfme(detlDto.getAnfme() + detail.getAnfme()); |
| | | // } else { |
| | | // list.add(dto); |
| | | // } |
| | | // } |
| | | for (DetlDto detlDto : param.getMatList()) { |
| | | Mat mat = matService.selectByMatnr(detlDto.getMatnr()); |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException(detlDto.getMatnr() + "编号商品检索失败,请先添加商品"); |
| | |
| | | orderDetl.setUpdateTime(now); |
| | | orderDetl.setStatus(1); |
| | | orderDetl.setQty(0.0D); |
| | | orderDetl.setWorkQty(0.0D); |
| | | orderDetl.setUnits(0.0); |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | | } |
| | |
| | | mat.sync(matParam); // |
| | | |
| | | mat.setTagId(tagId); |
| | | mat.setStatus(1); |
| | | mat.setStatus(matParam.getInspect()); |
| | | mat.setCreateTime(now); |
| | | mat.setUpdateTime(now); |
| | | mat.setUpdateTime(matParam.getSuspensionDate());//启用时间 |
| | | if (!matService.insert(mat)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } else { |
| | |
| | | Tag priTag = tagService.selectByName(matParam.getTagIdName(), 2); |
| | | matParam.setTagId(priTag.getId()); |
| | | mat.sync(matParam); // ⚠️ 同上 |
| | | mat.setUpdateTime(matParam.getSuspensionDate());//启用时间 |
| | | mat.setStatus(matParam.getInspect()); |
| | | if (!matService.update(mat, new EntityWrapper<Mat>().eq("matnr", matParam.getMatnr()))) { |
| | | throw new CoolException("更新已存在商品信息失败,请联系管理员"); |
| | | } |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.common.SpringUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.param.OpenOrderPakinParam; |
| | | import com.zy.asrs.entity.result.OrderRsult; |
| | | import com.zy.asrs.mapper.OrderDetlMapper; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.Format; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service("orderDetlService") |
| | | public class OrderDetlServiceImpl extends ServiceImpl<OrderDetlMapper, OrderDetl> implements OrderDetlService { |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | @Value("${erp.switch.ReviewOrderSwitch}") |
| | | private Boolean switchReviewOrderSwitch; |
| | | @Value("${erp.address.URL}") |
| | | private String URL; |
| | | @Value("${erp.address.inaddressSave}") |
| | | private String inaddressSave; |
| | | @Value("${erp.address.outaddressSave}") |
| | | private String outaddressSave; |
| | | |
| | | @Override |
| | | public List<OrderDetl> selectByOrderId(Long orderId) { |
| | |
| | | public boolean increaseWorkQty(Long orderId, String matnr, String batch, Double workQty) { |
| | | return this.baseMapper.increaseWorkQty(orderId, matnr, batch, workQty) > 0; |
| | | } |
| | | |
| | | @Override |
| | | public R U8Reporting(long id, Integer sts) { |
| | | String ERPPath=inaddressSave; |
| | | String ERPName=""; |
| | | OrderDetl orderDetl = orderDetlService.selectById(id); |
| | | Order order = orderService.selectByNo(orderDetl.getOrderNo()); |
| | | if (order==null){ |
| | | return R.error("没有找到改订单 id="+id); |
| | | } |
| | | OrderRsult orderRsult = new OrderRsult(); |
| | | OrderRsult.Login login = new OrderRsult.Login(); |
| | | OrderRsult.HeadTable headTable = new OrderRsult.HeadTable(); |
| | | OrderRsult.BodyTable bodyTable = new OrderRsult.BodyTable(); |
| | | login.setSAccID("999"); //账套号 固定 |
| | | login.setSUserID("sys");//U8登陆账号 固定 |
| | | login.setSPassword("123456");//U8登陆密码 固定 |
| | | login.setSServer("10.1.9.20");//U8服务器地址 固定 |
| | | orderRsult.setLogin(login); |
| | | orderRsult.setVerifier("sys");//单据类型 固定 |
| | | orderRsult.setCommandType(sts.equals(1) ? "新增" : "关闭");//操作类型 固定 |
| | | orderRsult.setVouchName("调拨单");//审核人 填写则自动审核 |
| | | |
| | | headTable.setCtvcode(order.getOrderNo());//调拨单号 默认 |
| | | //时间 |
| | | Date date=new Date(); |
| | | Format formatter = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String format = formatter.format(date); |
| | | headTable.setDtvdate(format);//单据日期 |
| | | headTable.setCmaker("sys");//制单人名称 |
| | | headTable.setVt_id("89");//模板号 默认 |
| | | |
| | | headTable.setCiwhcode("");//转入仓库编码 |
| | | headTable.setCowhcode("");//转出仓库编码 |
| | | headTable.setCordcode("");//出库类别编码 默认 |
| | | headTable.setCirdcode("");//入库类别编码 默认 |
| | | headTable.setCodepcode("");//转出部门编码 |
| | | headTable.setCidepcode("");//转入部门编码 |
| | | |
| | | |
| | | |
| | | bodyTable.setIrowno(orderDetl.getModel());//行号 |
| | | bodyTable.setCinvcode(orderDetl.getMatnr());//存货编码 |
| | | bodyTable.setCtvbatch(Cools.isEmpty(orderDetl.getBatch()) ? "" : orderDetl.getBatch());//批号(特殊说明) |
| | | Double qty = orderDetl.getQty()-(Cools.isEmpty(orderDetl.getUnits())?0:orderDetl.getUnits()); |
| | | bodyTable.setItvquantity(String.valueOf(qty));//完成件数 |
| | | bodyTable.setCinposcode("1-1");//立库源货位 |
| | | bodyTable.setCoutposcode("");//目标货位 |
| | | bodyTable.setItrsid(orderDetl.getMemo());//行主键 |
| | | bodyTable.setEditprop(sts.equals(1) ? "A" : "B");//状态 A 新增 |
| | | |
| | | |
| | | if (order.getDocType()>10L) { |
| | | ERPPath=outaddressSave; |
| | | } |
| | | ERPName=order.getDocType$(); |
| | | String response = ""; |
| | | boolean success = false; |
| | | try { |
| | | |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(map) |
| | | .setUri(URL) |
| | | .setPath(ERPPath) |
| | | .setJson(JSON.toJSONString(orderRsult)) |
| | | .build() |
| | | .doPost(); |
| | | System.out.println("response:"+response); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | orderDetl.setUnits(qty+orderDetl.getUnits()); |
| | | orderDetl.setStatus(sts); |
| | | orderDetlService.updateById(orderDetl); |
| | | success = true; |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", URL+"/"+ERPPath, JSON.toJSONString(orderRsult), response); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", URL+"/"+ERPPath, JSON.toJSONString(orderRsult), response); |
| | | } finally { |
| | | try { |
| | | // 保存接口日志 |
| | | ApiLogService apiLogService = SpringUtils.getBean(ApiLogService.class); |
| | | apiLogService.save( |
| | | "上报"+ERPName, |
| | | URL +"/"+ ERPPath, |
| | | null, |
| | | "127.0.0.1", |
| | | JSON.toJSONString(orderRsult), |
| | | response, |
| | | success |
| | | ); |
| | | } catch (Exception e) { |
| | | log.error("", e); |
| | | } |
| | | } |
| | | if (!success) { |
| | | return R.error(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Slf4j |
| | | @Service("orderService") |
| | |
| | | break; |
| | | } |
| | | } |
| | | if (complete) { |
| | | // 出库订单重新整理明细 |
| | | DocType docType = docTypeService.selectById(order.getDocType()); |
| | | if (null != docType && docType.getPakout() == 1) { |
| | | if (!orderDetlService.delete(new EntityWrapper<OrderDetl>().eq("order_id", order.getId()))) { |
| | | throw new CoolException("重整出库订单【orderNo = " + order.getOrderNo() + "】明细失败"); |
| | | } |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectAndLogByOrderNo(orderNo); |
| | | for (WrkDetl wrkDetl : wrkDetls) { |
| | | OrderDetl orderDetl = new OrderDetl(); |
| | | orderDetl.sync(wrkDetl); |
| | | orderDetl.setQty(orderDetl.getAnfme()); |
| | | orderDetl.setOrderId(order.getId()); |
| | | orderDetl.setOrderNo(orderNo); |
| | | orderDetl.setStatus(1); |
| | | orderDetl.setCreateTime(order.getCreateTime()); |
| | | orderDetl.setCreateBy(order.getCreateBy()); |
| | | orderDetl.setUpdateTime(order.getUpdateTime()); |
| | | orderDetl.setUpdateBy(order.getUpdateBy()); |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("重整出库订单【orderNo = " + order.getOrderNo() + "】明细失败"); |
| | | } |
| | | } |
| | | //当该订单明细数量==完成数量且>上报数量,上报状态为 否 或者 是 时都改成等待上报,定时器轮询等待上报进行上报 |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | if (Objects.equals(orderDetl.getAnfme(), orderDetl.getQty())&& |
| | | orderDetl.getQty()>orderDetl.getUnits() |
| | | &&orderDetl.getInspect()<2) { |
| | | orderDetl.setInspect(2);//等待上报 |
| | | orderDetlService.updateById(orderDetl); |
| | | } |
| | | |
| | | } |
| | | if (complete) { |
| | | if (!this.updateSettle(order.getId(), 4L, null)) { |
| | | throw new CoolException("修改订单【orderNo = " + order.getOrderNo() + "】状态为已完成失败"); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public boolean saveHandlerOrder(Boolean pakin, WrkMast wrkMast, List<WrkDetl> wrkDetls) { |
| | | try { |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | wrkDetls.forEach(wrkDetl -> { |
| | | detlDtos.add(new DetlDto(wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getAnfme())); |
| | | }); |
| | | String orderNo = "HAND" + snowflakeIdWorker.nextId(); |
| | | if (pakin) { |
| | | // 生成入库单据 |
| | | OpenOrderPakinParam openParam = new OpenOrderPakinParam(); |
| | | openParam.setOrderNo(orderNo); |
| | | openParam.setOrderTime(DateUtils.convert(wrkMast.getModiTime())); |
| | | openParam.setOrderType("手动入库单"); |
| | | openParam.setMatList(detlDtos); |
| | | openService.pakinOrderCreate(openParam); |
| | | } else { |
| | | // 生成出库单据 |
| | | OpenOrderPakoutParam openParam = new OpenOrderPakoutParam(); |
| | | openParam.setOrderNo(orderNo); |
| | | openParam.setOrderTime(DateUtils.convert(wrkMast.getModiTime())); |
| | | openParam.setOrderType("手动出库单"); |
| | | openParam.setOrderDetails(detlDtos); |
| | | openService.pakoutOrderCreate(openParam); |
| | | } |
| | | |
| | | Order order = this.selectByNo(orderNo); |
| | | if (null == order) { |
| | | throw new CoolException("生成单据失败"); |
| | | } |
| | | if (!this.updateSettle(order.getId(), 4L, null)) { |
| | | throw new CoolException("修改单据状态失败"); |
| | | } |
| | | for (DetlDto detlDto : detlDtos) { |
| | | // 修改订单明细数量 |
| | | if (!orderDetlService.increase(order.getId(), detlDto.getMatnr(), detlDto.getBatch(), detlDto.getAnfme())) { |
| | | throw new CoolException("修改单据明细数量失败"); |
| | | } |
| | | // 修改订单作业数量 |
| | | if (!orderDetlService.increaseWorkQty(order.getId(), detlDto.getMatnr(), detlDto.getBatch(), detlDto.getAnfme())) { |
| | | throw new CoolException("修改单据作业数量失败"); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("saveHandlerOrder===>>", e); |
| | | return false; |
| | | } |
| | | // try { |
| | | // List<DetlDto> detlDtos = new ArrayList<>(); |
| | | // wrkDetls.forEach(wrkDetl -> { |
| | | // detlDtos.add(new DetlDto(wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getAnfme())); |
| | | // }); |
| | | // String orderNo = "HAND" + snowflakeIdWorker.nextId(); |
| | | // if (pakin) { |
| | | // // 生成入库单据 |
| | | // OpenOrderPakinParam openParam = new OpenOrderPakinParam(); |
| | | // openParam.setOrderNo(orderNo); |
| | | // openParam.setOrderTime(DateUtils.convert(wrkMast.getModiTime())); |
| | | // openParam.setOrderType("手动入库单"); |
| | | // openParam.setMatList(detlDtos); |
| | | // openService.pakinOrderCreate(openParam); |
| | | // } else { |
| | | // // 生成出库单据 |
| | | // OpenOrderPakoutParam openParam = new OpenOrderPakoutParam(); |
| | | // openParam.setOrderNo(orderNo); |
| | | // openParam.setOrderTime(DateUtils.convert(wrkMast.getModiTime())); |
| | | // openParam.setOrderType("手动出库单"); |
| | | // openParam.setOrderDetails(detlDtos); |
| | | // openService.pakoutOrderCreate(openParam); |
| | | // } |
| | | // |
| | | // Order order = this.selectByNo(orderNo); |
| | | // if (null == order) { |
| | | // throw new CoolException("生成单据失败"); |
| | | // } |
| | | // if (!this.updateSettle(order.getId(), 4L, null)) { |
| | | // throw new CoolException("修改单据状态失败"); |
| | | // } |
| | | // for (DetlDto detlDto : detlDtos) { |
| | | // // 修改订单明细数量 |
| | | // if (!orderDetlService.increase(order.getId(), detlDto.getMatnr(), detlDto.getBatch(), detlDto.getAnfme())) { |
| | | // throw new CoolException("修改单据明细数量失败"); |
| | | // } |
| | | // // 修改订单作业数量 |
| | | // if (!orderDetlService.increaseWorkQty(order.getId(), detlDto.getMatnr(), detlDto.getBatch(), detlDto.getAnfme())) { |
| | | // throw new CoolException("修改单据作业数量失败"); |
| | | // } |
| | | // } |
| | | // } catch (Exception e) { |
| | | // log.error("saveHandlerOrder===>>", e); |
| | | // return false; |
| | | // } |
| | | return true; |
| | | } |
| | | |
New file |
| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.task.handler.WorkMastHandler; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Component |
| | | public class AutoReportingScheduler { |
| | | |
| | | private static final Logger log = LoggerFactory.getLogger(WorkMastScheduler.class); |
| | | |
| | | private OrderService orderService; |
| | | |
| | | private OrderDetlService orderDetlService; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void execute(){ |
| | | List< OrderDetl> orderDetls=orderDetlService.selectList(new EntityWrapper<OrderDetl>() |
| | | .eq("status",1) |
| | | .eq("inspect",2)); |
| | | if(Cools.isEmpty(orderDetls)){ |
| | | return; |
| | | } |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | orderDetlService.U8Reporting(orderDetl.getId(),1); |
| | | } |
| | | } |
| | | } |
| | |
| | | @Data |
| | | public class DetlDto { |
| | | |
| | | private String orderNo; |
| | | /** |
| | | * 1:正常 0:关闭 |
| | | */ |
| | | private Integer sts; |
| | | |
| | | /** |
| | | * 行号 |
| | | */ |
| | | private String model; |
| | | |
| | | /** |
| | | * 物料编码 |
| | | */ |
| | | private String matnr; |
| | | |
| | | /** |
| | | * 物料编码 |
| | | */ |
| | | private String maktx; |
| | | |
| | | /** |
| | | * 特殊说明 |
| | | */ |
| | | private String batch; |
| | | |
| | | /** |
| | | * 完成数量 |
| | | */ |
| | | private Double anfme; |
| | | |
| | | /** |
| | | * 规格 |
| | | */ |
| | | private String specs; |
| | | |
| | | /** |
| | | * 立库源货位(默认1-1) |
| | | */ |
| | | private String sourceStaNo = "1-1"; |
| | | |
| | | /** |
| | | * 目标货位 |
| | | */ |
| | | private String locNo = "2-2"; |
| | | |
| | | /** |
| | | * 行主键 |
| | | */ |
| | | private String memo; |
| | | |
| | | private String orderNo; |
| | | |
| | | |
| | | private Double units; |
| | | |
| | | public DetlDto() { |
| | |
| | | enabled: false |
| | | datasource: |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=tzglasrs |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=dlzasrs |
| | | username: sa |
| | | password: sa@123 |
| | | mvc: |
| | |
| | | erp: |
| | | # 开关 |
| | | switch: |
| | | #获取单据开关 |
| | | InboundOrderSwitch: false |
| | | #登录接口开关 |
| | | LoginAuthenticationSwitch: false |
| | | #上报、审核单据开关 |
| | | ReviewOrderSwitch: false |
| | | # 地址 |
| | | address: |
| | | URL: http://58.210.10.90:28090 |
| | | #登录地址 |
| | | loginaddress: K3CLOUD/Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser.common.kdsvc |
| | | #单据,商品档案地址 |
| | | inaddress: K3CLOUD/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExecuteBillQuery.common.kdsvc |
| | | #结果上报(保存)单地址 |
| | | outaddressSave: K3CLOUD/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save.common.kdsvc |
| | | #结果上报(提交)单地址 |
| | | outaddressSubmit: K3Cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Submit.common.kdsvc |
| | | #结果上报(审核)单地址 |
| | | outaddressAudit: K3CLOUD/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit.common.kdsvc |
| | | # 地址 |
| | | newaddress: |
| | | #单据上报地址 |
| | | URL: http://10.10.0.59:33117 |
| | | #单据提交 |
| | | orderaddressSubmit: api/U8Voucher |
| | | #盘点上报地址 |
| | | UPLOADURL: http://10.10.0.10:2501 |
| | | # 盘点地址 |
| | | uploadaddressSubmit: api/CheckVouch/pypk |
| | | |
| | | |
| | | # 登录账号管理 |
| | | login : |
| | | sAcctID: "999" |
| | | sUserId: "demo" |
| | | sPassword: "DEMO" |
| | | sServer: "10.1.9.20" |
| | | lcid: 1234 |
| | | URL: http://158.210.10.90:28090 |
| | | # #单据,商品档案地址 |
| | | # inaddress: K3CLOUD/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExecuteBillQuery.common.kdsvc |
| | | #入库结果上报(提交)单地址 |
| | | inaddressSave: K3CLOUD/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save.common.kdsvc |
| | | #出库结果上报(提交)单地址 |
| | | outaddressSave: K3Cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Submit.common.kdsvc |
| | |
| | | and mo.settle <= 2 |
| | | and mo.status = 1 |
| | | and mdt.pakout = 1 |
| | | and mod.status = 1 |
| | | <include refid="pakOutPageCondition"></include> |
| | | ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | // 渲染搜索模板 |
| | | $.ajax({ |
| | | url: baseUrl+"/docType/list/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | limit: 9999 |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | let template = Handlebars.compile($('#docTypeTpl').html()); |
| | | $('#docType-query').html(template(res.data)); |
| | | layui.form.render('select'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#orderDetl', |
| | |
| | | height: 'full-120', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'id', align: 'center',title: 'ID'} |
| | | ,{field: 'orderId$', align: 'center',title: '订单内码'} |
| | | // ,{field: 'id', align: 'center',title: 'ID'} |
| | | ,{field: 'orderNo', align: 'center',title: '订单编码',sort:true, width: 160} |
| | | ,{field: 'matnr', align: 'center',title: '商品编码',sort:true, width: 160} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称',sort:true, width: 160} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'matnr', align: 'center',title: '商品编码'} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称'} |
| | | ,{field: 'name', align: 'center',title: '名称'} |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | ,{field: 'model', align: 'center',title: '型号'} |
| | | ,{field: 'batch', align: 'center',title: '批号'} |
| | | ,{field: 'unit', align: 'center',title: '单位'} |
| | | ,{field: 'barcode', align: 'center',title: '商品条码'} |
| | | ,{field: 'supplier', align: 'center',title: '供应商'} |
| | | ,{field: 'unitPrice', align: 'center',title: '单价'} |
| | | ,{field: 'itemNum', align: 'center',title: '品项数'} |
| | | ,{field: 'count', align: 'center',title: '数量'} |
| | | ,{field: 'weight', align: 'center',title: '重量'} |
| | | ,{field: 'qty', align: 'center',title: '完成数量'} |
| | | // ,{field: 'model', align: 'center',title: '型号'} |
| | | ,{field: 'batch', align: 'center',title: '特殊说明'} |
| | | // ,{field: 'unit', align: 'center',title: '单位'} |
| | | ,{field: 'danger$', align: 'center',title: '订单类型'} |
| | | ,{field: 'anfme$', align: 'center', title: '订单状态', templet: '#settleTpl', minWidth: 120, width: 160}, |
| | | // ,{field: 'unitPrice', align: 'center',title: '单价'} |
| | | // ,{field: 'itemNum', align: 'center',title: '品项数'} |
| | | // ,{field: 'count', align: 'center',title: '数量'} |
| | | // ,{field: 'weight', align: 'center',title: '重量'} |
| | | // ,{field: 'status$', align: 'center',title: '状态'} |
| | | // ,{field: 'createBy$', align: 'center',title: '添加人员'} |
| | | // {field: 'createTime$', align: 'center',title: '添加时间'} |
| | | {field: 'workQty', align: 'center',title: '工作数量'} |
| | | // ,{field: 'updateBy$', align: 'center',title: '修改人员'} |
| | | ,{field: 'updateTime$', align: 'center',title: '修改时间',width:200} |
| | | ,{field: 'inspect$', align: 'center',title: '是否上报'} |
| | | ,{field: 'units', align: 'center',title: '上报数量'} |
| | | ,{field: 'status$', align: 'center',title: '状态'} |
| | | ,{field: 'createBy$', align: 'center',title: '添加人员'} |
| | | ,{field: 'createTime$', align: 'center',title: '添加时间'} |
| | | ,{field: 'updateBy$', align: 'center',title: '修改人员'} |
| | | ,{field: 'updateTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:200} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | showEditModel(); |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.id; |
| | | })); |
| | | break; |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.id; |
| | | })); |
| | | break; |
| | | case 'exportData': |
| | | admin.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | |
| | | table.on('tool(orderDetl)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | | case 'manualReporting': |
| | | manualReporting([data.id]); |
| | | break; |
| | | case "del": |
| | | del([data.id]); |
| | | break; |
| | | case "enable": |
| | | enable([data.id]); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: (mData ? '修改' : '添加') + '订单状态', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | layDateRender(mData); |
| | | form.val('detail', mData); |
| | | form.on('submit(editSubmit)', function (data) { |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/orderDetl/"+(mData?'update':'add')+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.close(dIndex); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | /* 手动上报 */ |
| | | function manualReporting(ids) { |
| | | layer.confirm('确定要手动上报选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/orderDetl/manualReporting/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | /* 删除 */ |
| | | function del(ids) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
| | | layer.confirm('确定要关闭选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | |
| | | }); |
| | | } |
| | | |
| | | /* 启用 */ |
| | | function enable(ids) { |
| | | layer.confirm('确定要启用选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/orderDetl/enable/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | // 时间选择器 |
| | | layDate.render({ |
| | | elem: '#ymd\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#wrkDate\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#ioTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#crnStrTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#crnEndTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#plcStrTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#crnPosTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#refIotime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#modiTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#appeTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#errorTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#logErrTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | |
| | | // 搜索 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | // 异常 |
| | | form.on('submit(abnormal)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(true); |
| | | // console.log("abnormal"); |
| | | // $.ajax({ |
| | | // url: baseUrl+"/orderDetl/abnormal", |
| | | // headers: {'token': localStorage.getItem('token')}, |
| | | // method: 'GET', |
| | | // success: function (res) { |
| | | // layer.close(loadIndex); |
| | | // if (res.code === 200){ |
| | | // layer.msg(res.msg, {icon: 1}); |
| | | // tableReload(); |
| | | // } else if (res.code === 403){ |
| | | // top.location.href = baseUrl+"/"; |
| | | // } else { |
| | | // layer.msg(res.msg, {icon: 2}); |
| | | // } |
| | | // } |
| | | // }) |
| | | |
| | | }); |
| | | |
| | | |
| | | // 时间选择器 |
| | | function layDateRender(data) { |
| | |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | // if(child){ |
| | | // searchData["abnormal"] = 1; |
| | | // }else { |
| | | // searchData["abnormal"] = 0; |
| | | // } |
| | | |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: pageCurr} |
| | | }); |
| | | }); |
| | | } |
| | |
| | | <div class="layui-form toolbar" id="search-box"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">编号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="order_no" placeholder="订单编号" |
| | | autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="matnr" placeholder="物料编码" |
| | | autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="batch" placeholder="批号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select name="be_batch" id="docType-query"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="create_time" type="text" |
| | | placeholder="起始时间 - 终止时间" |
| | | autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline">  |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/html" id="settleTpl"> |
| | | <span name="anfme" |
| | | {{# if( d.qty=== d.anfme){ }} |
| | | class="layui-badge layui-badge-green" |
| | | {{# }else if(d.workQty=== 0){ }} |
| | | class="layui-badge layui-badge-yellow" |
| | | {{# }else if(d.anfme> d.qty){ }} |
| | | class="layui-badge layui-badge-blue" |
| | | {{# }else if(d.anfme < d.qty){ }} |
| | | class="layui-badge layui-badge-red" |
| | | {{# }else if(d.workQty> 0){ }} |
| | | class="layui-badge layui-badge-blue" |
| | | {{# }else if(d.source === 6){ }} |
| | | class="layui-badge layui-badge-gray" |
| | | {{# } }} |
| | | >{{d.anfme$}}</span> |
| | | </script> |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">导出</button> |
| | | <!-- <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button>--> |
| | | <!-- <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button>--> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" |
| | | style="float: right">导出 |
| | | </button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="manualReporting">手动上报</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">关闭</a> |
| | | <a class="layui-btn layui-btn-sm layui-btn-xs btn-edit" lay-event="enable">启用</a> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/orderDetl/orderDetl.js" charset="utf-8"></script> |
| | | |
| | | <script type="text/template" id="docTypeTpl"> |
| | | <option value="">选择类型</option> |
| | | {{#each records}} |
| | | <option value="{{docId}}">{{docName}}</option> |
| | | {{/each}} |
| | | </script> |
| | | </body> |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | |
| | | <label class="layui-form-label">订单内码: </label> |
| | | <div class="layui-input-block cool-auto-complete"> |
| | | <input class="layui-input" name="orderId" placeholder="请输入订单内码" style="display: none"> |
| | | <input id="orderId$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="请输入订单内码" onfocus=this.blur()> |
| | | <input id="orderId$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" |
| | | type="text" placeholder="请输入订单内码" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="orderQueryByorderId" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="orderQueryByorderIdSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | <input class="cool-auto-complete-window-input" data-key="orderQueryByorderId" |
| | | onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="orderQueryByorderIdSelect" |
| | | onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">名称: </label> |
| | | <label class="layui-form-label">订单数量: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="name" placeholder="请输入名称"> |
| | | <input class="layui-input" name="anfme" placeholder="请输入名称"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">规格: </label> |
| | | <label class="layui-form-label">工作数量: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="specs" placeholder="请输入规格"> |
| | | <input class="layui-input" name="workQty" placeholder="请输入规格"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">型号: </label> |
| | | <label class="layui-form-label">完成数量: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="model" placeholder="请输入型号"> |
| | | <input class="layui-input" name="qty" placeholder="请输入型号"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | |
| | | <label class="layui-form-label">添加人员: </label> |
| | | <div class="layui-input-block cool-auto-complete"> |
| | | <input class="layui-input" name="createBy" placeholder="请输入添加人员" style="display: none"> |
| | | <input id="createBy$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="请输入添加人员" onfocus=this.blur()> |
| | | <input id="createBy$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" |
| | | type="text" placeholder="请输入添加人员" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="userQueryBycreateBy" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="userQueryBycreateBySelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | <input class="cool-auto-complete-window-input" data-key="userQueryBycreateBy" |
| | | onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="userQueryBycreateBySelect" |
| | | onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | <label class="layui-form-label">修改人员: </label> |
| | | <div class="layui-input-block cool-auto-complete"> |
| | | <input class="layui-input" name="updateBy" placeholder="请输入修改人员" style="display: none"> |
| | | <input id="updateBy$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="请输入修改人员" onfocus=this.blur()> |
| | | <input id="updateBy$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" |
| | | type="text" placeholder="请输入修改人员" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="userQueryByupdateBy" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="userQueryByupdateBySelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | <input class="cool-auto-complete-window-input" data-key="userQueryByupdateBy" |
| | | onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="userQueryByupdateBySelect" |
| | | onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <hr class="layui-bg-gray"> |
| | | <div class="layui-form-item text-right"> |
| | |
| | | </div> |
| | | </form> |
| | | </script> |
| | | |
| | | |
| | | </html> |
| | | |