Merge remote-tracking branch 'origin/tzhneasrs' into tzhneasrs
| | |
| | | import com.zy.common.CodeRes; |
| | | import com.zy.common.entity.PlaExcel; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.system.entity.OperateLog; |
| | | import com.zy.system.service.OperateLogService; |
| | | import lombok.Synchronized; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @RestController |
| | | @Slf4j |
| | |
| | | private MatService matService; |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | |
| | | @Resource |
| | | private OperateLogService operateLogService; |
| | | |
| | | // 获取下拉选择框值列表 |
| | | @GetMapping(value = "/pla/dropdownValues/list") |
| | | @ManagerAuth |
| | | public R list() { |
| | | List<DropdownValuesDto> list = plaService.getDropdownValues(); |
| | | Map<String, List<String>> map = new HashMap<>(); |
| | | |
| | | // owner 去重并加入 map |
| | | List<String> owners = list.stream() |
| | | .filter(dropdownValuesDto -> dropdownValuesDto.getType().equals("owner")) |
| | | .map(DropdownValuesDto::getValue) |
| | | .collect(Collectors.toList()); |
| | | map.put("owner", owners); |
| | | |
| | | // workshop 去重并加入 map |
| | | List<String> workshops = list.stream() |
| | | .filter(dropdownValuesDto -> dropdownValuesDto.getType().equals("workshop")) |
| | | .map(DropdownValuesDto::getValue) |
| | | .collect(Collectors.toList()); |
| | | map.put("workshop", workshops); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/pla/list/auth") |
| | |
| | | @RequestMapping(value = "/pla/update/auth") |
| | | @ManagerAuth |
| | | public R update(@RequestBody List<Pla> plas) { |
| | | log.info(plas.toString()); |
| | | Date date = new Date(); |
| | | plas.forEach(pla -> { |
| | | Pla plaSave = plaService.selectById(pla.getId()); |
| | | pla.setModifyTime(new Date()); |
| | |
| | | PlaLog plaLog = new PlaLog(); |
| | | BeanUtils.copyProperties(plaSave, plaLog); |
| | | plaLog.setId(null); |
| | | plaLog.setCreateTime(new Date()); |
| | | plaLog.setCreateTime(date); |
| | | plaLog.setModifyUser(getUser().getUsername()); |
| | | plaLogService.insert(plaLog); |
| | | |
| | | // 记录操作日志 |
| | | OperateLog operateLog = new OperateLog(); |
| | | operateLog.setAction("聚乳酸库存明细修改"); |
| | | operateLog.setUserId(getUserId()); |
| | | operateLog.setIp(request.getRemoteAddr()); |
| | | operateLog.setRequest(pla.toString()); |
| | | operateLog.setResponse(plaSave.toString()); |
| | | operateLog.setCreateTime(new Date()); |
| | | operateLogService.insert(operateLog); |
| | | |
| | | }); |
| | | return R.ok(); |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author pang.jiabao |
| | | * @description 下拉选择框值通用视图 |
| | | * @createDate 2025/10/23 13:36 |
| | | */ |
| | | @Data |
| | | public class DropdownValuesDto { |
| | | |
| | | private String type; |
| | | |
| | | private String value; |
| | | } |
| | |
| | | @ExcelProperty(value = "不透明度,%") |
| | | private Double opacity; |
| | | |
| | | @TableField("lactide_content") |
| | | @ExcelProperty(value = "丙交酯含量,%") |
| | | private Double lactideContent; |
| | | |
| | | //L值 |
| | | @TableField("l") |
| | | @ExcelProperty(value = "L*") |
| | |
| | | @TableField("memo") |
| | | private String memo; |
| | | |
| | | @TableField("lactide_content") |
| | | @ExcelProperty(value = "丙交酯含量,%") |
| | | private Double lactideContent; |
| | | |
| | | public String getPakinTime$() { |
| | | if (Cools.isEmpty(this.pakinTime)){ |
| | | return ""; |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.DropdownValuesDto; |
| | | import com.zy.asrs.entity.Pla; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | Integer getStockStatisCountAll(Map<String, Object> map); |
| | | |
| | | /** |
| | | * 获取下拉列表值 |
| | | */ |
| | | List<DropdownValuesDto> getDropdownValues(); |
| | | |
| | | /** |
| | | * 自动解冻冻结时间超过90天的库存 |
| | | * @return 更新数量 |
| | | */ |
| | |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.DropdownValuesDto; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.Pla; |
| | | import com.zy.asrs.entity.PlaQty; |
| | |
| | | |
| | | public interface PlaService extends IService<Pla> { |
| | | |
| | | List<DropdownValuesDto> getDropdownValues(); |
| | | |
| | | Pla selectByBatchAndPackageNo(String batch, Integer packageNo, String brand); |
| | | |
| | | void queryStock(OrderDetl orderDetl, List<PlaQty> plaQties); |
| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.DropdownValuesDto; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.Pla; |
| | | import com.zy.asrs.entity.PlaQty; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | @Autowired |
| | | private PlaQtyService plaQtyService; |
| | | |
| | | @Resource |
| | | private PlaMapper plaMapper; |
| | | |
| | | @Override |
| | | public List<DropdownValuesDto> getDropdownValues() { |
| | | return plaMapper.getDropdownValues(); |
| | | } |
| | | |
| | | public Pla selectByBatchAndPackageNo(String batch, Integer packageNo, String brand) { |
| | | return this.selectOne(new EntityWrapper<Pla>().eq("batch",batch).eq("package_no",packageNo).eq("brand",brand)); |
| | | } |
| | |
| | | pla.setVadf2(excel.getVadf2()); |
| | | pla.setYellowness(excel.getYellowness()); |
| | | pla.setOpacity(excel.getOpacity()); |
| | | pla.setLactideContent(excel.getLactideContent()); |
| | | pla.setL(excel.getL()); |
| | | pla.setA(excel.getA()); |
| | | pla.setB(excel.getB()); |
| | |
| | | </where> |
| | | GROUP BY brand,matnr,workshop HAVING SUM(weight_anfme) > 0 ORDER BY matnr,workshop |
| | | </select> |
| | | <select id="getDropdownValues" resultType="com.zy.asrs.entity.DropdownValuesDto"> |
| | | SELECT type, value |
| | | FROM dropdown_values_view |
| | | </select> |
| | | </mapper> |
| | |
| | | text-align: center; |
| | | } |
| | | div .layui-table-tool .layui-table-tool-self .layui-inline[title='导出']{ |
| | | display: none; |
| | | /*display: none;*/ |
| | | } |
| | | .layui-form.layui-border-box.layui-table-view{ |
| | | margin: 15px 0 35px 0; |
| | |
| | | ,{field: 'vadf2', align: 'center',title: '分解段,%', hide:true,edit:true} |
| | | ,{field: 'yellowness', align: 'center',title: '黄度',edit:true} |
| | | ,{field: 'opacity', align: 'center',title: '不透明度,%',edit:true} |
| | | ,{field: 'lactideContent', align: 'center',title: '丙交酯含量,%',edit:true} |
| | | ,{field: 'l', align: 'center',title: 'L*', hide:true,edit:true} |
| | | ,{field: 'a', align: 'center',title: 'a*', hide:true,edit:true} |
| | | ,{field: 'b', align: 'center',title: 'b*', hide:true,edit:true} |
| | |
| | | laydate = layui.laydate; |
| | | var form = layui.form; |
| | | admin = layui.admin; |
| | | |
| | | // 模拟从后端接口获取数据 |
| | | $.ajax({ |
| | | url: baseUrl + "/pla/dropdownValues/list", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | var data = res.data |
| | | |
| | | if (data.owner && Array.isArray(data.owner)) { |
| | | data.owner.forEach(function(item) { |
| | | $('#ownerSelect').append(new Option(item, item)); |
| | | }); |
| | | } |
| | | |
| | | if (data.workshop && Array.isArray(data.workshop)) { |
| | | data.workshop.forEach(function(item) { |
| | | $('#workshopSelect').append(new Option(item, item)); |
| | | }); |
| | | } |
| | | |
| | | // 重新渲染 LayUI 表单 |
| | | form.render('select'); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // 日期时间范围 |
| | | laydate.render({ |
| | |
| | | |
| | | var iframe = window['layui-layer-iframe' + index]; |
| | | iframe.child(dataSave) |
| | | }, |
| | | end: function() { |
| | | // ✅ 子页面关闭时刷新表格 |
| | | tableReload(false); // 或根据实际情况传 true/false |
| | | } |
| | | }); |
| | | }) |
| | |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="action" placeholder="操作内容" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="request" placeholder="请求数据" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="response" placeholder="返回数据" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 日期范围 --> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="owner" placeholder="主体" autocomplete="off"> |
| | | <select id="ownerSelect" name="owner" lay-search> |
| | | <option value="">主体</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select id="workshopSelect" name="workshop" lay-search> |
| | | <option value="">车间</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="lactide_contentMax" placeholder="最小丙交酯" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="lactide_contentMax" placeholder="最大丙交酯" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select id="ownerSelect" name="owner" lay-search> |
| | | <option value="">主体</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select id="workshopSelect" name="workshop" lay-search> |
| | | <option value="">车间</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="lactide_contentMax" placeholder="最小丙交酯" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="lactide_contentMax" placeholder="最大丙交酯" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <script type="text/html" id="toolbar"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select id="ownerSelect" name="owner" lay-search> |
| | | <option value="">主体</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select id="workshopSelect" name="workshop" lay-search> |
| | | <option value="">车间</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="lactide_contentMax" placeholder="最小丙交酯" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="lactide_contentMax" placeholder="最大丙交酯" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <script type="text/html" id="toolbar"> |