| | |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param) { |
| | | Page<LocDetl> stockStatis = locDetlService.getStockStatis(toPage(curr, limit, param, LocDetl.class)); |
| | | for (LocDetl locDetl : stockStatis.getRecords()) { |
| | | Mat mat = matService.selectByMatnr(locDetl.getMatnr()); |
| | | if (mat != null) { |
| | | locDetl.sync(mat); |
| | | } |
| | | } |
| | | // for (LocDetl locDetl : stockStatis.getRecords()) { |
| | | // Mat mat = matService.selectByMatnr(locDetl.getMatnr()); |
| | | // if (mat != null) { |
| | | // locDetl.sync(mat); |
| | | // } |
| | | // } |
| | | return R.ok().add(stockStatis); |
| | | } |
| | | |
| | |
| | | private Double weight; |
| | | |
| | | @ApiModelProperty(value= "长度") |
| | | @TableField("man_length") |
| | | private Double manLength; |
| | | |
| | | @ApiModelProperty(value= "体积") |
| | | @TableField("volume") |
| | | private Double volume; |
| | | |
| | | @ApiModelProperty(value= "三方编码") |
| | |
| | | /** |
| | | * 体积 |
| | | */ |
| | | @ApiModelProperty(value= "体积") |
| | | @ApiModelProperty(value= "罐装量") |
| | | private Double volume; |
| | | |
| | | /** |
| | |
| | | @TableField("rgv_dsta_no") |
| | | private Integer rgvDstaNo; |
| | | |
| | | @ApiModelProperty(value= "rgv命令下发时间") |
| | | @TableField("rgv_create_time") |
| | | private Date rgvCreateTime; |
| | | |
| | | @ApiModelProperty(value= "rgv任务完成时间") |
| | | @TableField("rgv_finish_time") |
| | | private Date rgvFinishTime; |
| | | |
| | | /** |
| | | * 伴生工作号 |
| | | */ |
| | |
| | | @TableField("rgv_dsta_no") |
| | | private Integer rgvDstaNo; |
| | | |
| | | @ApiModelProperty(value= "rgv命令下发时间") |
| | | @TableField("rgv_create_time") |
| | | private Date rgvCreateTime; |
| | | |
| | | @ApiModelProperty(value= "rgv任务完成时间") |
| | | @TableField("rgv_finish_time") |
| | | private Date rgvFinishTime; |
| | | |
| | | /** |
| | | * 伴生工作号 |
| | | */ |
| | |
| | | int workNoOther = 0; |
| | | // 入库 + 库位转移 |
| | | if ((wrkMast.getWrkSts() < 4 && wrkMast.getIoType() != 101 && wrkMast.getIoType() != 110) || (wrkMast.getWrkSts() > 10 |
| | | && wrkMast.getIoType()==11) || wrkMast.getIoType() == 10) { |
| | | && wrkMast.getIoType()==11) || wrkMast.getIoType() == 10 || (wrkMast.getIoType() == 3)) { |
| | | wrkMast.setWrkSts(4L); |
| | | workNoOther = wrkMast.getWorkNoOther(); |
| | | // 出库 |
| | |
| | | @Resource |
| | | private WrkMastService wrkMastService; |
| | | |
| | | // 读补尾桶配置,给对应任务号补尾桶信号 |
| | | // 读补尾桶配置,给对应任务号补尾桶信号--替换为入库寻找库位时,发现前面类型不一样单着,自动补尾桶 |
| | | @Scheduled(cron = "0/5 * * * * ?") |
| | | private void tailFillingBuckets() { |
| | | Config config = configService.selectConfigByCode("tailFillingBuckets"); |
| | |
| | | private LocMastService locMastService; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void execute(){ |
| | | public void execute(){ |
| | | List<WrkMast> wrkMasts = wrkMastService.selectToBeHistoryData(); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | |
| | | private WorkMastHandler workMastHandler; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void execute(){ |
| | | public void execute(){ |
| | | List<WrkMast> wrkMasts = wrkMastService.selectToBeCompleteData(); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
New file |
| | |
| | | package com.zy.common.config; |
| | | |
| | | /** |
| | | * @author pang.jiabao |
| | | * @description MyBaits plus sql拦截器配置 |
| | | * @createDate 2024/10/25 16:18 |
| | | */ |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.context.annotation.Bean; |
| | | |
| | | //@Configuration |
| | | @MapperScan("src.resources.mapper") // 替换为你的Mapper包路径 |
| | | public class MyBatisPlusConfig { |
| | | |
| | | @Bean |
| | | public SlowSqlInterceptor slowSqlInterceptor() { |
| | | return new SlowSqlInterceptor(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.common.config; |
| | | /** |
| | | * @author pang.jiabao |
| | | * @description 记录慢sql日志 |
| | | * @createDate 2024/10/25 16:18 |
| | | */ |
| | | import org.apache.ibatis.executor.Executor; |
| | | import org.apache.ibatis.mapping.MappedStatement; |
| | | import org.apache.ibatis.plugin.*; |
| | | import org.apache.ibatis.session.ResultHandler; |
| | | import org.apache.ibatis.session.RowBounds; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.util.Properties; |
| | | |
| | | @Intercepts({ |
| | | @Signature(type = Executor.class, method = "update", args = {MappedStatement.class, Object.class}), |
| | | @Signature(type = Executor.class, method = "query", args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class}) |
| | | }) |
| | | public class SlowSqlInterceptor implements Interceptor { |
| | | |
| | | private static final Logger logger = LoggerFactory.getLogger(com.zy.common.config.SlowSqlInterceptor.class); |
| | | |
| | | @Override |
| | | public Object intercept(Invocation invocation) throws Throwable { |
| | | MappedStatement ms = (MappedStatement) invocation.getArgs()[0]; |
| | | String sqlId = ms.getId(); // 获取 SQL ID |
| | | // 获取 SQL 语句,可以用 sqlSource |
| | | String sql = ms.getBoundSql(invocation.getArgs()[1]).getSql(); // 获取具体的 SQL 语句 |
| | | |
| | | long startTime = System.currentTimeMillis(); |
| | | Object result = invocation.proceed(); |
| | | long duration = System.currentTimeMillis() - startTime; |
| | | |
| | | if (duration > 500) { // 阈值 |
| | | logger.warn("慢SQL: {},执行时间: {}毫秒,具体SQL: {}", sqlId, duration, sql); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public Object plugin(Object o) { |
| | | return Plugin.wrap(o, this); |
| | | } |
| | | |
| | | @Override |
| | | public void setProperties(Properties properties) { |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | locMast = locMastList.get(0); |
| | | } else { // 奇数,不可以入库 |
| | | // 自动给前面任务补尾桶信号 |
| | | if (wrkMast.getCtnType() == 0) { |
| | | wrkMast.setCtnType(1); |
| | | wrkMastService.updateById(wrkMast); |
| | | log.info("自动补尾桶信号成功,任务号:{}",wrkMast.getCtnType()); |
| | | } |
| | | log.error("-----与前面桶类型不一样,前面桶不是尾桶,前面该桶类型任务数不是偶数,不能入库----"); |
| | | throw new CoolException("与前面桶类型不一样,前面桶不是尾桶,前面该桶类型任务数不是偶数,不能入库"); |
| | | } |
| | |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.EmptyPlateOutParam; |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.asrs.entity.result.FindLocNoAttributeVo; |
| | | import com.zy.asrs.mapper.LocMastMapper; |
| | | import com.zy.asrs.mapper.WrkMastMapper; |
| | |
| | | // wrkDetl.setManuDate(param.getManuDate()); |
| | | // wrkDetl.setWeight(param.getWeight()); |
| | | // wrkDetl.setManLength(param.getGrossWeight()); |
| | | // wrkDetl.setVolume(param.getCannedVolume()); // 罐装量 |
| | | // wrkDetl.setInspect(param.isTbFlag()?1:0); // 贴标成功 |
| | | // wrkDetl.setIoTime(now); |
| | | // wrkDetl.setAppeTime(now); |
| | |
| | | wrkDetl.setManuDate(param.getManuDate()); |
| | | wrkDetl.setWeight(param.getWeight()); |
| | | wrkDetl.setManLength(param.getGrossWeight()); |
| | | wrkDetl.setVolume(param.getCannedVolume()); // 罐装量 |
| | | wrkDetl.setInspect(1); |
| | | wrkDetl.setIoTime(now); |
| | | wrkDetl.setAppeTime(now); |
| | |
| | | wrkDetl.setManuDate(param.getManuDate()); |
| | | wrkDetl.setWeight(param.getWeight()); |
| | | wrkDetl.setManLength(param.getGrossWeight()); |
| | | wrkDetl.setVolume(param.getCannedVolume()); |
| | | wrkDetl.setInspect(1); // 贴标成功 |
| | | wrkDetl.setIoTime(now); |
| | | wrkDetl.setAppeTime(now); |
| | |
| | | return wrkMastService.insert(wrkMast) ? R.ok("自动空托入库成功,工作号:"+wrkMast.getWrkNo()) : R.error("生成自动空托入库失败"); |
| | | } |
| | | |
| | | // 自动出空桶 |
| | | @PostMapping("/autoOutEmptyBucket") |
| | | @ResponseBody |
| | | public R autoOutEmptyBucket(@RequestBody StockOutParam param){ |
| | | workService.startupFullTakeStore(param, 29L); |
| | | return R.ok("出库启动成功"); |
| | | } |
| | | |
| | | @PostMapping("auto/emptyOut/v1") |
| | | @ResponseBody |
| | | public R autoEmptyOut(@RequestBody Map<String,String> emptyPalletSite){ |
| | |
| | | wrkMast.setIoTime(new Date()); |
| | | wrkMast.setWrkSts(2L); // 工作状态:生成入库ID |
| | | wrkMast.setIoType(10); // 入出库状态:10.空板入库 |
| | | wrkMast.setIoPri(13D); // 优先级 |
| | | wrkMast.setIoPri(14D); // 优先级 |
| | | wrkMast.setCrnNo(dto.getCrnNo()); |
| | | wrkMast.setSourceStaNo(dto.getSourceStaNo()); |
| | | wrkMast.setStaNo(dto.getStaNo()); |
| | |
| | | // 复检合格否 |
| | | private boolean reinspection; |
| | | |
| | | // 罐装量 |
| | | private double cannedVolume; |
| | | |
| | | // 源站点 |
| | | private Integer sourceStaNo; |
| | | |
| | |
| | | |
| | | mybatis-plus: |
| | | mapper-locations: classpath:mapper/*.xml |
| | | |
| | | # configuration: |
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | logging: |
| | | path: /stock/out/@pom.build.finalName@/logs |
| | | |
| | |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | </appender> |
| | | |
| | | <appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
| | | <level>WARN</level> |
| | | </filter> |
| | | <file>${LOG_PATH}/warn.log</file> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <FileNamePattern>${LOG_PATH}/warn_%d{yyyy-MM-dd}.%i.log</FileNamePattern> |
| | | <maxHistory>10</maxHistory> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>10MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{35} - %msg %n</pattern> |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | </appender> |
| | | <!--info级别--> |
| | | <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${LOG_PATH}/info.log</file> |
| | |
| | | select |
| | | ROW_NUMBER() over (order by sum(a.anfme) desc) as row |
| | | , a.matnr |
| | | , a.batch |
| | | , a.maktx |
| | | , a.model |
| | | , a.volume |
| | | , sum(a.anfme) as anfme |
| | | from asr_loc_detl a |
| | | where 1=1 |
| | | <include refid="stockOutCondition"></include> |
| | | group by a.matnr, a.batch |
| | | group by a.matnr,a.maktx,a.model,a.volume |
| | | ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | |
| | |
| | | ( |
| | | select |
| | | a.matnr |
| | | , a.maktx |
| | | , a.model |
| | | , a.volume |
| | | from asr_loc_detl a |
| | | where 1=1 |
| | | <include refid="stockOutCondition"></include> |
| | | group by a.matnr |
| | | group by a.matnr, a.maktx, a.model,a.volume |
| | | ) b |
| | | </select> |
| | | |
| | |
| | | <result column="rgv_no" property="rgvNo" /> |
| | | <result column="rgv_ssta_no" property="rgvSstaNo" /> |
| | | <result column="rgv_dsta_no" property="rgvDstaNo" /> |
| | | <result column="rgv_create_time" property="rgvCreateTime" /> |
| | | <result column="rgv_finish_time" property="rgvFinishTime" /> |
| | | <result column="work_no_other" property="workNoOther" /> |
| | | <result column="Pdc_type" property="pdcType" /> |
| | | </resultMap> |
| | |
| | | <result column="rgv_no" property="rgvNo" /> |
| | | <result column="rgv_ssta_no" property="rgvSstaNo" /> |
| | | <result column="rgv_dsta_no" property="rgvDstaNo" /> |
| | | <result column="rgv_create_time" property="rgvCreateTime" /> |
| | | <result column="rgv_finish_time" property="rgvFinishTime" /> |
| | | <result column="work_no_other" property="workNoOther" /> |
| | | <result column="Pdc_type" property="pdcType" /> |
| | | </resultMap> |
| | |
| | | </select> |
| | | |
| | | <select id="selectToBeHistoryData" resultMap="BaseResultMap"> |
| | | select * from asr_wrk_mast |
| | | where wrk_sts=5 and dateadd(mi,1,modi_time) <= getdate() and wrk_no not in (select wrk_no from asr_bas_devp) |
| | | or (wrk_sts=15 and ove_mk='Y' and wrk_no not in (select wrk_no from asr_bas_devp)) |
| | | or (wrk_sts=15 and dateadd(mi,1,modi_time) <= getdate() and wrk_no not in (select wrk_no from asr_bas_devp)) |
| | | or (wrk_sts=15 and crn_end_time is null and wrk_no not in (select wrk_no from asr_bas_devp)) |
| | | order by io_time,wrk_no asc |
| | | SELECT a.* |
| | | FROM asr_wrk_mast a |
| | | LEFT JOIN asr_bas_devp b ON a.wrk_no = b.wrk_no |
| | | WHERE b.wrk_no IS NULL |
| | | AND ( |
| | | (a.wrk_sts = 5 AND a.modi_time < DATEADD(mi, -1, GETDATE())) |
| | | OR |
| | | (a.wrk_sts = 15 AND ( |
| | | a.ove_mk = 'Y' OR |
| | | a.modi_time <= DATEADD(mi, -1, GETDATE()) OR |
| | | a.crn_end_time IS NULL |
| | | )) |
| | | ) OPTION (RECOMPILE) |
| | | </select> |
| | | |
| | | <select id="selectWrkMastWrkDetl" resultMap="BaseResultMap"> |
| | |
| | | </select> |
| | | <select id="selectInGzxCount" resultType="java.lang.Integer"> |
| | | SELECT |
| | | count(m.wrk_no) |
| | | count(DISTINCT m.wrk_no) |
| | | FROM |
| | | asr_wrk_mast m |
| | | LEFT JOIN asr_bas_devp d ON |
| | | m.wrk_no = d.wrk_no |
| | | WHERE |
| | | (m.wrk_sts IN (2, 9) |
| | | (m.wrk_sts IN (2, 9 ,10,14) |
| | | AND m.sta_no = #{site} |
| | | AND d.wrk_no IS NOT NULL) |
| | | OR (m.wrk_sts = 10 |
| | | OR (m.wrk_sts IN(10,11,12,14) |
| | | AND m.sta_no = #{site} |
| | | AND d.wrk_no IS NULL) |
| | | </select> |
| | |
| | | var detlCols = [ |
| | | {field: 'matnr', align: 'center',title: '商品编号(品号)', sort:true} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称(品名)', sort:true} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', hide: false} |
| | | ,{field: 'batch', align: 'center',title: '货品特征', sort:true} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', hide: true} |
| | | ,{field: 'batch', align: 'center',title: '货品特征', sort:true, hide: true} |
| | | ,{field: 'anfme', align: 'center',title: '数量', hide: false} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码', hide: false} |
| | | |
| | | ,{field: 'specs', align: 'center',title: '规格', hide: false} |
| | | ,{field: 'model', align: 'center',title: '代码', hide: true} |
| | | ,{field: 'specs', align: 'center',title: '规格', hide: true} |
| | | ,{field: 'model', align: 'center',title: '桶型', hide: false} |
| | | ,{field: 'color', align: 'center',title: '颜色', hide: true} |
| | | ,{field: 'brand', align: 'center',title: '品牌', hide: true} |
| | | ,{field: 'unit', align: 'center',title: '单位', hide: false} |
| | | ,{field: 'unit', align: 'center',title: '单位', hide: true} |
| | | ,{field: 'price', align: 'center',title: '单价', hide: true} |
| | | ,{field: 'sku', align: 'center',title: 'sku', hide: true} |
| | | ,{field: 'units', align: 'center',title: '单位量', hide: true} |
| | |
| | | ,{field: 'safeQty', align: 'center',title: '安全库存量', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '净重', hide: true} |
| | | ,{field: 'manLength', align: 'center',title: '毛重', hide: true} |
| | | ,{field: 'volume', align: 'center',title: '单箱体积', hide: true} |
| | | ,{field: 'volume', align: 'center',title: '罐装量', hide: false} |
| | | ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: true} |
| | | ,{field: 'supp', align: 'center',title: '供应商', hide: true} |
| | | ,{field: 'suppCode', align: 'center',title: '供应商编码', hide: true} |
| | |
| | | ,{field: 'barcode', align: 'center',title: '条码', hide: true} |
| | | ,{field: 'origin', align: 'center',title: '产地', hide: true} |
| | | ,{field: 'manu', align: 'center',title: '厂家', hide: true} |
| | | ,{field: 'manuDate', align: 'center',title: '生产日期', hide: true} |
| | | ,{field: 'manuDate', align: 'center',title: '生产日期', hide: false} |
| | | ,{field: 'itemNum', align: 'center',title: '品项数', hide: true} |
| | | ,{field: 'safeQty', align: 'center',title: '安全库存量', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '净重'} |
| | | ,{field: 'man_length', align: 'center',title: '毛重'} |
| | | ,{field: 'manLength', align: 'center',title: '毛重'} |
| | | ,{field: 'length', align: 'center',title: '单箱毛重', hide: true} |
| | | ,{field: 'volume', align: 'center',title: '单箱体积', hide: true} |
| | | ,{field: 'volume', align: 'center',title: '罐装量', hide: false} |
| | | ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: true} |
| | | ,{field: 'supp', align: 'center',title: '供应商', hide: true} |
| | | ,{field: 'suppCode', align: 'center',title: '供应商编码', hide: true} |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="batch" placeholder="批号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="volume" placeholder="罐装量" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | <input class="layui-input" type="text" name="model" placeholder="桶型" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select name="frozen" class="layui-input" type="text" autocomplete="off"> |
| | | <!-- <option style="display: none"></option>--> |
| | | <option value="">冻结否</option> |
| | | <option value="0">未冻结</option> |
| | | <option value="1">已冻结</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <select name="frozen" class="layui-input" type="text" autocomplete="off">--> |
| | | <!-- <!– <option style="display: none"></option>–>--> |
| | | <!-- <option value="">冻结否</option>--> |
| | | <!-- <option value="0">未冻结</option>--> |
| | | <!-- <option value="1">已冻结</option>--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <div class="layui-input-inline">--> |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="matnr" placeholder="商品编号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="maktx" placeholder="商品名称" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="specs" placeholder="规格" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="model" placeholder="桶型" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="maktx" placeholder="物料描述" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="volume" placeholder="罐装量" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |