diff --git a/ym-admin/src/main/java/com/cnbm/admin/utils/JwtUtil.java b/ym-admin/src/main/java/com/cnbm/admin/utils/JwtUtil.java index f895449..6aad6a0 100644 --- a/ym-admin/src/main/java/com/cnbm/admin/utils/JwtUtil.java +++ b/ym-admin/src/main/java/com/cnbm/admin/utils/JwtUtil.java @@ -82,9 +82,11 @@ public class JwtUtil { public static void main(String[] args) throws Exception { // String jwt = createJWT("123"); - Claims claims = parseJWT("eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI5OWNhNGJhMjg5ZjU0OTVjODE5YTM0N2ExZmNlZjc0YSIsInN1YiI6IjEyMyIsImlzcyI6IndoeSIsImlhdCI6MTY1NDc1OTg5NiwiZXhwIjoxNjU0NzYzNDk2fQ.CTgS6yQjfXSGPJUTu-_rqjkh_KB_F9SzPThFfnvB5yg"); + Claims claims = parseJWT("eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJkNTQxODQ5NjNjMWM0NzgzOTA0ZDAwZGI1ZmNkNWU3NiIsInN1YiI6IjEwNjcyNDY4NzU4MDAwMDAwMDEiLCJpc3MiOiJ3aHkiLCJpYXQiOjE2Nzg5MzE1MjAsImV4cCI6MTY3ODkzNTEyMH0.2we9FhhFU2Qvx2fvywqmA8A1qs0mbdXvr8T2CjJUz7o"); String subject = claims.getSubject(); System.out.println(subject); + + System.out.println(claims.toString()); // System.out.println(claims); } diff --git a/ym-gateway/src/main/resources/application-dev.yml b/ym-gateway/src/main/resources/application-dev.yml index da8f64c..cc956c6 100644 --- a/ym-gateway/src/main/resources/application-dev.yml +++ b/ym-gateway/src/main/resources/application-dev.yml @@ -2,14 +2,14 @@ spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver #MySQL-local - url: jdbc:mysql://10.0.1.249:3306/mt_cigs4?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true - username: cigs4 - password: 1qazxsw2 +# url: jdbc:mysql://10.0.1.249:3306/mt_cigs4?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true +# username: cigs4 +# password: 1qazxsw2 #MySQL-remote -# url: jdbc:mysql://mysql.picaiba.com:30307/mt_cigs4?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true -# username: root -# password: 1qaz@WSX3edc$RFV + url: jdbc:mysql://mysql.picaiba.com:30307/mt_cigs4?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true + username: root + password: 1qaz@WSX3edc$RFV # #Oracle # driver-class-name: oracle.jdbc.OracleDriver # url: jdbc:oracle:thin:@192.168.10.10:1521:xe @@ -66,15 +66,15 @@ dynamic: # username: root # password: 1qaz@WSX3edc$RFV ## camline系统 - remote -# camline: -# driver-class-name: com.mysql.cj.jdbc.Driver -# url: jdbc:mysql://mysql.picaiba.com:30307/mt_cigs4?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true -# username: root -# password: 1qaz@WSX3edc$RFV -# - #camline系统 - local camline: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://10.0.1.23:3306/synapse?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true - username: offline_data - password: tpvmfab4 \ No newline at end of file + url: jdbc:mysql://mysql.picaiba.com:30307/mt_cigs4?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true + username: root + password: 1qaz@WSX3edc$RFV +# + #camline系统 - local +# camline: +# driver-class-name: com.mysql.cj.jdbc.Driver +# url: jdbc:mysql://10.0.1.23:3306/synapse?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true +# username: offline_data +# password: tpvmfab4 \ No newline at end of file diff --git a/ym-gateway/src/main/resources/application.yml b/ym-gateway/src/main/resources/application.yml index 209f3fc..bb0ed3e 100644 --- a/ym-gateway/src/main/resources/application.yml +++ b/ym-gateway/src/main/resources/application.yml @@ -33,8 +33,8 @@ spring: enabled: true redis: database: 6 - #host: 127.0.0.1 - host: 10.0.1.249 + host: 127.0.0.1 + #host: 10.0.1.249 #host: 192.168.0.102 port: 6379 password: '' # 密码(默认为空) diff --git a/ym-gateway/src/main/resources/logback.xml b/ym-gateway/src/main/resources/logback.xml index 15c84a5..9107c9c 100644 --- a/ym-gateway/src/main/resources/logback.xml +++ b/ym-gateway/src/main/resources/logback.xml @@ -14,9 +14,9 @@ - - - + + + diff --git a/ym-packing/src/main/java/com/cnbm/dispatch/KukaJoinThread.java b/ym-packing/src/main/java/com/cnbm/dispatch/KukaJoinThread.java index 06c9ecf..75d92ac 100644 --- a/ym-packing/src/main/java/com/cnbm/dispatch/KukaJoinThread.java +++ b/ym-packing/src/main/java/com/cnbm/dispatch/KukaJoinThread.java @@ -184,11 +184,11 @@ public class KukaJoinThread implements ApplicationRunner { } //return true 出现混档了,return false 没有出现混档 - private boolean isMixLevel(String[] subIds){ + private boolean isMixLevel(String[] subIds,Integer size){ String correctLevel = substrateServiceBiz.getBySubId(subIds[0]).getPowerLevel(); String errMsg = "以下基板ID出现混档:"; boolean res = false; - for(int i=1;i> subPageMapper(@Validated({Default.class}) @RequestBody SubIdQueryParam param) { + + return boxServiceBiz.subIdPage(param); + } + + @PostMapping("/forImport") public R forImport() throws UnsupportedEncodingException, ParseException { List alllCamlineSubForImp = service.getAlllCamlineSubForImp(); @@ -135,6 +158,74 @@ public class TestController { return R.ok(); } + @PostMapping("/forTestMix") + public R forTestMix() throws UnsupportedEncodingException, ParseException { + String[] s = new String[20]; + s[0]= "30110012303021614"; + s[1]= "30110012303022415"; + s[2]= "30110012303022801"; + s[3]= "30110012303040003"; + s[4]= "30110012303030488"; + s[5]= "30110012303020247"; + s[6]= "30110012303021008"; + s[7]= "30110012303022434"; + s[8]= "30110012303012878"; + s[9]= "30110012302281212"; + s[10]= "30110012302281213"; + s[11]= "30110012302281215"; + s[12]= "30110012302271160"; + s[13]= "30110012302271154"; + s[14]= "30110012303050321"; + s[15]= "30110012303050331"; + s[16]= "30110012303020036"; + s[17]= "30110012303022606"; + s[18]= "30110012303030009"; + s[19]= "30110012303021795"; + System.out.println(isMixLevel(s));; + WoPackagingBoxSubstrate bySubId = substrateServiceBiz.getBySubId(s[0]); + System.out.println(bySubId.getSapMaterial()); + System.out.println(getErrorBoxId(bySubId.getSapMaterial())); + System.out.println(getBoxId(bySubId.getSapMaterial())); + + return R.ok(); + } + public String formateString(Integer a){ + Format f1 = new DecimalFormat("000"); + return f1.format(a); + } + public String getBoxId(String sapMaterial){ + Integer todayBoxNum = service.getTodayBoxNum()+1; + String nowTime = DateUtil.format(new Date(), "yyMMdd"); + + todayBoxNum+=500; + String res = "301"+sapMaterial+nowTime+formateString(todayBoxNum); + return res; + } + public String getErrorBoxId(String sapMaterial){ + + String nowTime = DateUtil.format(new Date(), "yyMMdd"); + String mixBoxError = "001"; + String res = "Err"+sapMaterial+nowTime+mixBoxError; + return res; + } + private boolean isMixLevel(String[] subIds){ + String correctLevel = substrateServiceBiz.getBySubId(subIds[0]).getPowerLevel(); + String errMsg = "以下基板ID出现混档:"; + boolean res = false; + for(int i=1;i().ok(dto.getId()); } + @ApiOperation("查询模组档位统计分布图powerReportTY") + @LogOperation("查询模组档位统计分布图powerReportTY") + @PostMapping("/powerReportTY") + public Result powerReportTY(@RequestBody PowerReportQueryParam queryParam){ + List powerReportDTOS = boxServiceBiz.powerReport(queryParam); + System.out.println(powerReportDTOS); + return new Result().ok(true); + } + @ApiOperation("查询模组档位统计分布图") @LogOperation("查询模组档位统计分布图") @PostMapping("/powerReport") public Result powerReport(@RequestBody PowerReportQueryParam queryParam){ List powerReportDTOS = boxServiceBiz.powerReport(queryParam); System.out.println(powerReportDTOS.toString()); + List powerReportList = new ArrayList<>(); + powerReportList.add(new PowerReportDTO(0,"115",0f,"0%")); + powerReportList.add(new PowerReportDTO(0,"120",0f,"0%")); + powerReportList.add(new PowerReportDTO(0,"125",0f,"0%")); + powerReportList.add(new PowerReportDTO(0,"130",0f,"0%")); + powerReportList.add(new PowerReportDTO(0,"135",0f,"0%")); + powerReportList.add(new PowerReportDTO(0,"140",0f,"0%")); + powerReportList.add(new PowerReportDTO(0,"145",0f,"0%")); + powerReportList.add(new PowerReportDTO(0,"150",0f,"0%")); + powerReportList.add(new PowerReportDTO(0,"155",0f,"0%")); + powerReportList.add(new PowerReportDTO(0,"160",0f,"0%")); + + + for(PowerReportDTO power : powerReportList){ + for(PowerReportDTO inner : powerReportDTOS){ + if(Objects.equals(power.getSubLevel(), inner.getSubLevel())){ + power.setProportion(inner.getProportion()); + power.setSubNum(inner.getSubNum()); + power.setSumPMPP(inner.getSumPMPP()); + power.setSubLevel(inner.getSubLevel()); + } + } + } + + System.out.println(powerReportList.toString()); PowerReportVo powerReportVo = new PowerReportVo(); Float totalLevelPower = new Float(0); Float totalCompensatePower = new Float(0); Float diversePower = new Float(0); Integer totalSubNum = 0; - for(PowerReportDTO power : powerReportDTOS){ + for(PowerReportDTO power : powerReportList){ Integer subLevel = Integer.valueOf(power.getSubLevel()); Integer subNum = power.getSubNum(); + if(power.getSumPMPP()==null){ + return new Result().error("基板等级:"+subLevel+",基板数量:"+subNum+", 的总和为null"); + } Float sumPMPP = power.getSumPMPP(); totalLevelPower += subLevel*subNum; totalCompensatePower += sumPMPP*subNum; totalSubNum+= subNum; } - for(PowerReportDTO power : powerReportDTOS){ + for(PowerReportDTO power : powerReportList){ Float prop = (Float.valueOf(power.getSubNum())/Float.valueOf(totalSubNum))*100; DecimalFormat df = new DecimalFormat("0.00"); String propS = df.format(prop)+"%"; power.setProportion(propS); } + + diversePower = totalCompensatePower - totalLevelPower; - powerReportVo.setPowerReports(powerReportDTOS); + powerReportVo.setPowerReports(powerReportList); powerReportVo.setDiversePower(diversePower); powerReportVo.setTotalCompensatePower(totalCompensatePower); powerReportVo.setTotalLevelPower(totalLevelPower); diff --git a/ym-packing/src/main/java/com/cnbm/packing/dto/PowerReportDTO.java b/ym-packing/src/main/java/com/cnbm/packing/dto/PowerReportDTO.java index 6839b4f..f87a080 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/dto/PowerReportDTO.java +++ b/ym-packing/src/main/java/com/cnbm/packing/dto/PowerReportDTO.java @@ -31,4 +31,13 @@ public class PowerReportDTO implements Serializable { @ApiModelProperty(value = "占比(百分比)") private String proportion; + public PowerReportDTO() { + } + + public PowerReportDTO(Integer subNum, String subLevel, Float sumPMPP, String proportion) { + this.subNum = subNum; + this.subLevel = subLevel; + this.sumPMPP = sumPMPP; + this.proportion = proportion; + } } \ No newline at end of file diff --git a/ym-packing/src/main/java/com/cnbm/packing/mapper/WoPackagingBoxSubstrateMapper.java b/ym-packing/src/main/java/com/cnbm/packing/mapper/WoPackagingBoxSubstrateMapper.java index f8241ac..e32f480 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/mapper/WoPackagingBoxSubstrateMapper.java +++ b/ym-packing/src/main/java/com/cnbm/packing/mapper/WoPackagingBoxSubstrateMapper.java @@ -1,7 +1,11 @@ package com.cnbm.packing.mapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.cnbm.packing.dto.PowerReportDTO; import com.cnbm.packing.dto.WoPackagingBoxSubstrateDTO; import com.cnbm.packing.param.PowerReportQueryParam; +import com.cnbm.packing.param.SubIdQueryParam; +import com.cnbm.packing.vo.SubIdPageVo; import org.apache.ibatis.annotations.Param; import com.cnbm.common.dao.BaseDao; @@ -28,4 +32,6 @@ public interface WoPackagingBoxSubstrateMapper extends BaseDao orderNameList(); List substrateList(@Param("woSubstrateId") String woSubstrateId); + + IPage subIdPage(Page page, @Param("param") SubIdQueryParam param); } diff --git a/ym-packing/src/main/java/com/cnbm/packing/param/PowerReportQueryParam.java b/ym-packing/src/main/java/com/cnbm/packing/param/PowerReportQueryParam.java index c103777..3665cfd 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/param/PowerReportQueryParam.java +++ b/ym-packing/src/main/java/com/cnbm/packing/param/PowerReportQueryParam.java @@ -1,5 +1,6 @@ package com.cnbm.packing.param; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.time.LocalDateTime; @@ -11,10 +12,11 @@ import java.time.LocalDateTime; */ @Data public class PowerReportQueryParam { + //@JsonFormat(shape=JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime begin; + //@JsonFormat(shape= JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime end; private String orderName; - private Integer model; } diff --git a/ym-packing/src/main/java/com/cnbm/packing/param/SubIdQueryParam.java b/ym-packing/src/main/java/com/cnbm/packing/param/SubIdQueryParam.java new file mode 100644 index 0000000..00cc587 --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/packing/param/SubIdQueryParam.java @@ -0,0 +1,15 @@ +package com.cnbm.packing.param; + +import com.cnbm.packing.vo.BasePageParam; +import lombok.Data; + +/** + * @Desc: "" + * @Author: caixiang + * @DATE: 2023/2/15 19:05 + */ +@Data +public class SubIdQueryParam extends BasePageParam { + private String boxNo; + +} diff --git a/ym-packing/src/main/java/com/cnbm/packing/service/WoPackagingBoxServiceBiz.java b/ym-packing/src/main/java/com/cnbm/packing/service/WoPackagingBoxServiceBiz.java index 10f0106..ff76740 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/service/WoPackagingBoxServiceBiz.java +++ b/ym-packing/src/main/java/com/cnbm/packing/service/WoPackagingBoxServiceBiz.java @@ -1,5 +1,7 @@ package com.cnbm.packing.service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.cnbm.common.page.PageData; import com.cnbm.common.service.CrudService; import com.cnbm.packing.dto.IdVo; @@ -8,6 +10,9 @@ import com.cnbm.packing.dto.WoPackagingBoxDTO; import com.cnbm.packing.entity.WoPackagingBox; import com.cnbm.packing.entity.WoPackagingBoxSubstrate; import com.cnbm.packing.param.PowerReportQueryParam; +import com.cnbm.packing.param.SubIdQueryParam; +import com.cnbm.packing.vo.R; +import com.cnbm.packing.vo.SubIdPageVo; import org.apache.ibatis.annotations.Param; import java.time.LocalDateTime; @@ -49,4 +54,6 @@ public interface WoPackagingBoxServiceBiz extends CrudService powerReport(PowerReportQueryParam queryParam); List orderNameList(); + + R> subIdPage(SubIdQueryParam param); } \ No newline at end of file diff --git a/ym-packing/src/main/java/com/cnbm/packing/service/impl/WoPackagingBoxServiceBizImpl.java b/ym-packing/src/main/java/com/cnbm/packing/service/impl/WoPackagingBoxServiceBizImpl.java index f55250d..503939f 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/service/impl/WoPackagingBoxServiceBizImpl.java +++ b/ym-packing/src/main/java/com/cnbm/packing/service/impl/WoPackagingBoxServiceBizImpl.java @@ -3,6 +3,7 @@ package com.cnbm.packing.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.cnbm.admin.utils.BaseSupportUtils; import com.cnbm.common.page.PageData; import com.cnbm.common.service.impl.CrudServiceImpl; @@ -15,8 +16,11 @@ import com.cnbm.packing.entity.WoPackagingBoxSubstrate; import com.cnbm.packing.mapper.WoPackagingBoxMapper; import com.cnbm.packing.mapper.WoPackagingBoxSubstrateMapper; import com.cnbm.packing.param.PowerReportQueryParam; +import com.cnbm.packing.param.SubIdQueryParam; import com.cnbm.packing.service.WoPackagingBoxServiceBiz; import com.cnbm.packing.service.WoPackagingBoxSubstrateServiceBiz; +import com.cnbm.packing.vo.R; +import com.cnbm.packing.vo.SubIdPageVo; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -237,4 +241,12 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl orderNameList() { return substrateMapper.orderNameList(); } + + @Override + public R> subIdPage(SubIdQueryParam param) { + IPage iPage = substrateMapper.subIdPage( + new Page<>(param.getCurrent(), param.getSize()), + param); + return R.ok(iPage); + } } \ No newline at end of file diff --git a/ym-packing/src/main/java/com/cnbm/packing/vo/ApiErrorCode.java b/ym-packing/src/main/java/com/cnbm/packing/vo/ApiErrorCode.java new file mode 100644 index 0000000..03789ba --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/packing/vo/ApiErrorCode.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2018. + * http://www.ulabcare.com + */ + +package com.cnbm.packing.vo; + + +/** + * REST API 错误码 + * + * @author jiff + * @date 2018/11/1 + * @since 1.0 + */ +public enum ApiErrorCode implements IErrorCode { + + /** + * 成功 + */ + SUCCESSFUL(CODE_SUCCESSFUL, "成功"), + /** + * 失败 + */ + FAILED(CODE_FAILED, "失败"), + /** + * 无效的请求参数 + */ + //INVALID_PARAMETER(CODE_INVALID_PARAMETER, "无效的请求参数"), + INVALID_PARAMETER(CODE_INVALID_PARAMETER, "Invalid request parameter"), + /** + * 数据未授权 + */ + FORBIDDEN_DATA(CODE_FORBIDDEN_DATA, "数据未授权"), + /** + * 用户已存在 + */ + USER_EXISTENT(CODE_USER_EXISTENT, "用户已存在"), + /** + * 用户不存在 + */ + //USER_NON_EXISTENT(CODE_USER_NON_EXISTENT, "用户不存在"), + USER_NON_EXISTENT(CODE_USER_NON_EXISTENT, "User does not exist"), + /** + * 用户已停用 + */ + USER_DISABLED(CODE_FAILED, "用户已停用"), + /** + * 用户不存在或密码错误 + */ + USER_NON_EXISTENT_OR_INVALID_PASSWORD(CODE_FAILED, "The user does not exist or the password is wrong"), + //USER_NON_EXISTENT_OR_INVALID_PASSWORD(CODE_FAILED, "用户不存在或密码错误"), + /** + * 密码错误 + */ + //INVALID_PASSWORD(CODE_FAILED, "密码错误"), + INVALID_PASSWORD(CODE_FAILED, "Wrong password"), + + /** + * 电话号码不能为空 + */ + MOBILE_IS_EMPTY(CODE_FAILED, "手机号码不能为空"), + + /** + * 用户未登录 + */ + UNAUTHORIZED(CODE_UNAUTHORIZED, "用户未登录"), + /** + * 用户未授权 + */ + FORBIDDEN(CODE_FORBIDDEN, "用户未授权"); + + private final int code; + private final String msg; + + ApiErrorCode(final int code, final String msg) { + this.code = code; + this.msg = msg; + } + + public static ApiErrorCode fromCode(int code) { + ApiErrorCode[] apiErrorCodes = ApiErrorCode.values(); + for (ApiErrorCode apiErrorCode : apiErrorCodes) { + if (apiErrorCode.getCode() == code) { + return apiErrorCode; + } + } + return SUCCESSFUL; + } + + @Override + public int getCode() { + return code; + } + + @Override + public String getMsg() { + return msg; + } + + @Override + public String toString() { + return String.format(" ErrorCode:{code=%s, msg=%s} ", code, msg); + } +} diff --git a/ym-packing/src/main/java/com/cnbm/packing/vo/BasePageParam.java b/ym-packing/src/main/java/com/cnbm/packing/vo/BasePageParam.java new file mode 100644 index 0000000..d69c098 --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/packing/vo/BasePageParam.java @@ -0,0 +1,33 @@ +package com.cnbm.packing.vo; + + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.hibernate.validator.constraints.Range; + +import javax.validation.constraints.NotNull; + +/** + * 分页入参基础类 + * + * @author Mr.ZhangShi + * @date 2018/11/6 11:03 + */ +@Data +@EqualsAndHashCode(callSuper = false) +public class BasePageParam extends BaseParam { + @ApiModelProperty(value = "当前页", required = true, example = "1") + @NotNull(message = "页码不能为空") + @Range(min = 1, message = "页码必须大于等于1") + private Integer current; + + @ApiModelProperty(value = "每页显示条数", required = true, example = "10") + @NotNull(message = "每页显示条数不能为空") + @Range(min = 1, max = 1000, message = "每页显示条数范围需在1-1000之间") + private Integer size; + + @ApiModelProperty(value = "启用状态", notes = "0 、停用,1、启用", example = "1") + @Range(min = 0, max = 1, message = "启用状态只能为0或1") + private Integer enabled; +} diff --git a/ym-packing/src/main/java/com/cnbm/packing/vo/BaseParam.java b/ym-packing/src/main/java/com/cnbm/packing/vo/BaseParam.java new file mode 100644 index 0000000..5b88818 --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/packing/vo/BaseParam.java @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2018. + * http://www.ulabcare.com + */ + +package com.cnbm.packing.vo; + +import java.io.Serializable; + +/** + * 接口请求参数基类 + * + * @author jiff + * @date 2018/11/1 + * @since 1.0 + */ +public class BaseParam implements Serializable { + +} diff --git a/ym-packing/src/main/java/com/cnbm/packing/vo/IErrorCode.java b/ym-packing/src/main/java/com/cnbm/packing/vo/IErrorCode.java new file mode 100644 index 0000000..bc34c49 --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/packing/vo/IErrorCode.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2018. + * http://www.ulabcare.com + */ + +package com.cnbm.packing.vo; + + +/** + * api错误码定义 + * + * @author jiff + * @date 2018/11/1 + * @since 1.0 + */ +public interface IErrorCode { + /** + * 成功 + */ + int CODE_SUCCESSFUL = 0; + /** + * 失败 + */ + int CODE_FAILED = 1; + /** + * 无效的请求参数 + */ + int CODE_INVALID_PARAMETER = 2; + /** + * 数据未授权 + */ + int CODE_FORBIDDEN_DATA = 9; + /** + * 用户已存在 + */ + int CODE_USER_EXISTENT = 10; + /** + * 用户不存在 + */ + int CODE_USER_NON_EXISTENT = 11; + /** + * 用户未登录 + */ + int CODE_UNAUTHORIZED = 401; + /** + * 用户未授权 + */ + int CODE_FORBIDDEN = 403; + + /** + * 错误编码:0、成功 否则失败 + * + * @return 错误码:0、成功 否则失败 + */ + int getCode(); + + /** + * 错误描述 + * + * @return 错误描述 + */ + String getMsg(); +} diff --git a/ym-packing/src/main/java/com/cnbm/packing/vo/R.java b/ym-packing/src/main/java/com/cnbm/packing/vo/R.java new file mode 100644 index 0000000..675773f --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/packing/vo/R.java @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2018. + * http://www.ulabcare.com + */ + +package com.cnbm.packing.vo; + + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.*; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 处理结果类 + * + * @param 返回的数据类型 + * @author jiff + * @date 2018/11/7 + * @since 1.0 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@ToString +@ApiModel("处理结果类") +@Accessors +public class R implements Serializable { + @NonNull + @ApiModelProperty(value = "结果码", example = "0") + private int code = IErrorCode.CODE_SUCCESSFUL; + @ApiModelProperty(value = "结果说明", example = "成功") + private String msg; + @ApiModelProperty(value = "业务数据") + private T data; + + public R code(int code) { + this.code = code; + return this; + } + + public R msg(String msg) { + this.msg = msg; + return this; + } + + public R data(T data) { + this.data = data; + return this; + } + + public boolean ok() { + return code == IErrorCode.CODE_SUCCESSFUL; + } + + public static R failed() { + return failed("系统错误!"); + } + + public static R failed(String msg) { + return failed(ApiErrorCode.FAILED.getCode(), msg); + } + + public static R failed(int code, String msg) { + return failed(code, msg, null); + } + + public static R failed(int code, String msg, T data) { + return r(code == ApiErrorCode.SUCCESSFUL.getCode() ? ApiErrorCode.FAILED.getCode() : code, msg, data); + } + + public static R failed(IErrorCode errorCode) { + return r(errorCode, null); + } + + public static R r(IErrorCode errorCode, T data) { + return r(errorCode.getCode(), errorCode.getMsg(), data); + } + + public static R r(int code, String msg, T data) { + return new R().code(code).msg(msg).data(data); + } + + public static R unauthorized() { + return failed(ApiErrorCode.UNAUTHORIZED); + } + + public static R forbidden() { + return failed(ApiErrorCode.FORBIDDEN); + } + + public static R ok(T data) { + return new R().data(data); + } + + public static R ok(String msg, T data) { + return new R().msg(msg).data(data); + } + +} diff --git a/ym-packing/src/main/java/com/cnbm/packing/vo/SubIdPageVo.java b/ym-packing/src/main/java/com/cnbm/packing/vo/SubIdPageVo.java new file mode 100644 index 0000000..afcb288 --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/packing/vo/SubIdPageVo.java @@ -0,0 +1,19 @@ +package com.cnbm.packing.vo; + +import com.cnbm.packing.dto.PowerReportDTO; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * @Desc: "" + * @Author: caixiang + * @DATE: 2023/3/6 9:34 + */ +@Data +public class SubIdPageVo { + private LocalDateTime createTime; + private String subId; + private String boxNo; +} diff --git a/ym-packing/src/main/resources/mapper/CamlineMapper.xml b/ym-packing/src/main/resources/mapper/CamlineMapper.xml index 73ab205..31de29c 100644 --- a/ym-packing/src/main/resources/mapper/CamlineMapper.xml +++ b/ym-packing/src/main/resources/mapper/CamlineMapper.xml @@ -154,70 +154,61 @@ LEFT JOIN er_order eo ON tu.ORDER_ID = eo.ID WHERE tu.NAME IN ( - '30110012302272191', - '30110012302131618', - '30110012303012944', - '30110012303020207', - '30110012302241261', - '30110012302241398', - '30110012302230861', - '30110012302233064', - '30110012302281480', - '30110012302282683', - '30110012302240071', - '30110012302250901', - '30110012303011030', - '30110012302250913', - '30110012302270254', - '30110012302092199', - '30110012303020200', - '30110012303012545', - '30110012302142542', - '30110012302232978', - '30110012303020850', - '30110012303020177', - '30110012302250223', - '30110012302232990', - '30110012303013332', - '30110012302232986', - '30110012302232985', - '30110012302284455', - '30110012302233312', - '30110012303020358', - '30110012302282341', - '30110012303020199', - '30110012302272331', - '30110012303021196', - '30110012302233336', - '30110012303020006', - '30110012302242395', - '30110012302233328', - '30110012303012521', - '30110012302233506', - '30110012302242632', - '30110012302233332', - '30110012302232981', - '30110012303020183', - '30110012302283758', - '30110012302280081', - '30110012303020128', - '30110012302241074', - '30110012303020008', - '30110012303020088', - '30110012302232982', - '30110012303012916', - '30110012302230019', - '30110012302271634', - '30110012302251127', - '30110012302230021', - '30110012303010971', - '30110012302251123', - '30110012302140610' - - - - - + '30110012303050629', + '30110012302272118', + '30110012303050331', + '30110012303050321', + '30110012303030164', + '30110012303023000', + '30110012303011203', + '30110012303012089', + '30110012303011487', + '30110012302271154', + '30110012302283324', + '30110012303030787', + '30110012303050373', + '30110012303022841', + '30110012303021008', + '30110012303030325', + '30110012302283810', + '30110012303011490', + '30110012303022163', + '30110012303012695', + '30110012303010372', + '30110012303020247', + '30110012303022801', + '30110012303022407', + '30110012303012915', + '30110012303022996', + '30110012303022721', + '30110012303040003', + '30110012303023102', + '30110012302281213', + '30110012303022204', + '30110012302281212', + '30110012303022970', + '30110012303022415', + '30110012303050341', + '30110012303022434', + '30110012302271569', + '30110012303030505', + '30110012303021276', + '30110012302280295', + '30110012303022166', + '30110012303022299', + '30110012303020988', + '30110012302271160', + '30110012302281215', + '30110012303050537', + '30110012302272052', + '30110012303011213', + '30110012303030488', + '30110012303021614', + '30110012303012878', + '30110012302242962', + '30110012303030608', + '30110012303012697', + '30110012303020737' ) and flc.PMPP != 0 GROUP BY tu.`NAME` @@ -239,7 +230,10 @@ diff --git a/ym-packing/src/main/resources/mapper/WoPackagingBoxSubstrateMapper.xml b/ym-packing/src/main/resources/mapper/WoPackagingBoxSubstrateMapper.xml index aa8eb5c..1502e53 100644 --- a/ym-packing/src/main/resources/mapper/WoPackagingBoxSubstrateMapper.xml +++ b/ym-packing/src/main/resources/mapper/WoPackagingBoxSubstrateMapper.xml @@ -80,7 +80,11 @@ limit 1 - + + + + + update t_wo_packaging_box_substrate set PACKAGING_BOX_ID = #{packagingBoxId,jdbcType=VARCHAR}, @@ -132,5 +136,17 @@ order by twpb.CREATE_TIME desc + +