add:拣选页面机功能
This commit is contained in:
@@ -31,7 +31,7 @@ public enum StatusEnum {
|
||||
/**
|
||||
* 出入库单据类型
|
||||
*/
|
||||
IOBILL_TYPE_IN(ForkMap.of("生产入库", "10","inStorageTask", "调拨入库", "11","inStorageTask", "退货入库", "12","inStorageTask")),
|
||||
IOBILL_TYPE_IN(ForkMap.of("生产入库", "10","inStorageTask", "调拨入库", "11","inStorageTask", "退货入库", "12","inStorageTask","拣选回库", "13","inStorageTask")),
|
||||
IOBILL_TYPE_OUT(ForkMap.of("销售出库", "20","outStorageTask","生产出库", "21","outStorageTask", "调拨出库", "22","outStorageTask", "拣选出库", "23","outStorageTask")),
|
||||
|
||||
/**
|
||||
|
||||
@@ -75,11 +75,11 @@ public class BmFormStrucController {
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject param){
|
||||
//逻辑判断:如果有数据了则不允许修改
|
||||
BmFormStruc formStruc = param.toJavaObject(BmFormStruc.class);
|
||||
List<PmFormData> formDatas = iPmFormDataService.getByType(param.getString("form_type"));
|
||||
if (!CollectionUtils.isEmpty(formDatas)){
|
||||
throw new BadRequestException("当前表单存在数据,不允许直接修改");
|
||||
}
|
||||
formStruc.setUpdate_time(DateUtil.now());
|
||||
// List<PmFormData> formDatas = iPmFormDataService.getByType(param.getString("form_type"));
|
||||
// if (!CollectionUtils.isEmpty(formDatas)){
|
||||
// throw new BadRequestException("当前表单存在数据,不允许直接修改");
|
||||
// }
|
||||
// formStruc.setUpdate_time(DateUtil.now());
|
||||
formStruc.setUpdate_name(SecurityUtils.getCurrentUserId());
|
||||
iBmFormStrucService.updateById(formStruc);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
|
||||
@@ -69,7 +69,7 @@ public class BmFormStrucServiceImpl extends ServiceImpl<BmFormStrucMapper, BmFor
|
||||
List<BmFormStruc> childList = childMap.get(strucDto.getId());
|
||||
if (CollectionUtil.isNotEmpty(childList)) {
|
||||
strucDto.setHasChildren(true);
|
||||
strucDto.setChildren(CopyUtil.copyList(childList,BmFormStrucDto.class));
|
||||
strucDto.setChildren(CopyUtil.copyList(findChildren(childList),BmFormStrucDto.class));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,8 +81,8 @@ public class StrucFormActivityBehavior extends FlowNodeActivityBehavior<JSONObje
|
||||
//TODO:id,code等非映射字段后续可以通过SpringEL表达式生成
|
||||
JSONObject mst_json = handler.getJSONObject("t");
|
||||
mst_json.put("id",IdUtil.getStringId());
|
||||
mst_json.put("create_time",DateUtil.now());
|
||||
mst_json.put("form_type",targetStruc.getForm_type());
|
||||
mst_json.put("create_time",DateUtil.now());
|
||||
mst_json.put("create_name",SecurityUtils.getCurrentNickName());
|
||||
mst_json.put("status",StatusEnum.FORM_STATUS.code("生成"));
|
||||
mst_json.put("code",CodeUtil.getNewCode(currentNode.getForm_type()));
|
||||
@@ -92,11 +92,18 @@ public class StrucFormActivityBehavior extends FlowNodeActivityBehavior<JSONObje
|
||||
JSONArray itemArr = handler.getJSONArray("item");
|
||||
if(itemArr !=null){
|
||||
for (int i = 0; i < itemArr.size(); i++) {
|
||||
JSONObject dtl = itemArr.getJSONObject(i);
|
||||
dtl.put("inv_id",mst.getId());
|
||||
JSONObject item = itemArr.getJSONObject(i);
|
||||
JSONObject dtl = item.getJSONObject("t");
|
||||
dtl.put("parent_id",mst.getId());
|
||||
dtl.put("create_time",DateUtil.now());
|
||||
dtl.put("create_name",SecurityUtils.getCurrentNickName());
|
||||
dtl.put("status",StatusEnum.FORM_STATUS.code("生成"));
|
||||
dtl.put("id",IdUtil.getStringId());
|
||||
dtl.put("source_form_id",item.getString("source_form_id"));
|
||||
dtl.put("source_form_type",item.getString("source_form_type"));
|
||||
dtl.put("form_type",item.getString("form_type"));
|
||||
PmFormData iostorinvdtl= dtl.toJavaObject(PmFormData.class);
|
||||
item.put("form_id",iostorinvdtl.getId());
|
||||
iPmFormDataService.save(iostorinvdtl);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,9 +75,13 @@ public class MappingHandler extends TypeHandler<JSONObject, JSONObject> {
|
||||
if (skip.contains("#M")){
|
||||
formDataSpelMap.put(item,skip);
|
||||
continue;
|
||||
}else {
|
||||
value = sourceFormData.getString(skip);
|
||||
}
|
||||
if(skip.contains("#V[]")){
|
||||
//直接指定参数
|
||||
value = sourceFormData.getString(skip);
|
||||
continue;
|
||||
}
|
||||
value = sourceFormData.getString(skip);
|
||||
}
|
||||
}
|
||||
form_data.put(item,value);
|
||||
|
||||
@@ -45,16 +45,17 @@ public class PmFormData implements Serializable {
|
||||
/**
|
||||
* 业务单据编号
|
||||
*/
|
||||
private String biz_id;
|
||||
private String source_form_id;
|
||||
|
||||
/**
|
||||
* 业务单据编号
|
||||
*/
|
||||
private String biz_code;
|
||||
private String source_form_type;
|
||||
|
||||
/**
|
||||
* 业务单据日期
|
||||
*/
|
||||
private String biz_date;
|
||||
private String source_form_date;
|
||||
|
||||
/**
|
||||
* 单据类型
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
<result property="id" column="id"/>
|
||||
<result property="code" column="code"/>
|
||||
<result property="proc_inst_id" column="proc_inst_id"/>
|
||||
<result property="biz_code" column="biz_code"/>
|
||||
<result property="biz_id" column="biz_id"/>
|
||||
<result property="biz_date" column="biz_date"/>
|
||||
<result property="source_form_type" column="source_form_type"/>
|
||||
<result property="source_form_id" column="source_form_id"/>
|
||||
<result property="source_form_date" column="source_form_date"/>
|
||||
<result property="form_type" column="form_type"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="create_name" column="create_name"/>
|
||||
@@ -26,9 +26,9 @@
|
||||
<result property="id" column="id"/>
|
||||
<result property="code" column="code"/>
|
||||
<result property="proc_inst_id" column="proc_inst_id"/>
|
||||
<result property="biz_code" column="biz_code"/>
|
||||
<result property="biz_id" column="biz_id"/>
|
||||
<result property="biz_date" column="biz_date"/>
|
||||
<result property="source_form_type" column="source_form_type"/>
|
||||
<result property="source_form_id" column="source_form_id"/>
|
||||
<result property="source_form_type" column="source_form_type"/>
|
||||
<result property="form_type" column="form_type"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="create_name" column="create_name"/>
|
||||
@@ -75,6 +75,9 @@
|
||||
<if test="query.form_type != null and query.form_type != ''">
|
||||
and form_type = #{query.form_type}
|
||||
</if>
|
||||
<if test="query.parent_id != null and query.parent_id != ''">
|
||||
and parent_id = #{query.parent_id}
|
||||
</if>
|
||||
<if test="query.form_query != null and query.form_query.size() > 0">
|
||||
<foreach collection="query.form_query" item="value" index="key" >
|
||||
<if test="value != null and value != ''">
|
||||
|
||||
@@ -14,5 +14,6 @@ import java.util.Map;
|
||||
public class FormDataQuery extends BaseQuery<PmFormData> {
|
||||
|
||||
private String form_type;
|
||||
private String parent_id;
|
||||
private Map<String,String> form_query;
|
||||
}
|
||||
|
||||
@@ -43,16 +43,16 @@ public class PmFormDataDto implements Serializable {
|
||||
/**
|
||||
* 业务单据编号
|
||||
*/
|
||||
private String biz_id;
|
||||
private String source_form_id;
|
||||
/**
|
||||
* 业务单据编号
|
||||
*/
|
||||
private String biz_code;
|
||||
private String source_form_type;
|
||||
|
||||
/**
|
||||
* 业务单据日期
|
||||
*/
|
||||
private String biz_date;
|
||||
private String source_form_date;
|
||||
|
||||
/**
|
||||
* 单据类型
|
||||
|
||||
@@ -146,9 +146,12 @@ public class PmFormDataServiceImpl extends ServiceImpl<PmFormDataMapper, PmFormD
|
||||
|
||||
@Override
|
||||
public Object getSonDtlFormData(String id) {
|
||||
LambdaQueryWrapper<PmFormData> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.eq(PmFormData::getParent_id, id);
|
||||
return this.list(lqw);
|
||||
if (StringUtils.isEmpty(id)){
|
||||
throw new BadRequestException("请求参数不能为空");
|
||||
}
|
||||
FormDataQuery query = new FormDataQuery();
|
||||
query.setParent_id(id);
|
||||
return this.baseMapper.queryTree(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package org.nl.wms.stor_manage.pick.controller;
|
||||
|
||||
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.wms.pm_manage.form_data.service.IPmFormDataService;
|
||||
import org.nl.wms.pm_manage.form_data.service.dto.FormDataQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 表单信息表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-03-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/picking")
|
||||
public class PickingController {
|
||||
|
||||
@Autowired
|
||||
private IPmFormDataService formDataService;
|
||||
|
||||
|
||||
@GetMapping()
|
||||
public ResponseEntity<Object> queryAll(FormDataQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(formDataService.queryTree(query,page)), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@GetMapping("/getSonFormData/{id}")
|
||||
public ResponseEntity<Object> getSonDtlFormData(@PathVariable String id){
|
||||
//参数判读,参数解析,调用参数入库
|
||||
//Page<BmFormStruc> page = iBmFormStrucService.page(pageQuery.build(), query.build());
|
||||
return new ResponseEntity<>(formDataService.getSonDtlFormData(id),HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/sync/{type}")
|
||||
public ResponseEntity<Object> sync(@RequestParam String type, String formDtl) {
|
||||
//参数判读,参数解析,调用参数入库
|
||||
formDataService.syncFormData("type", formDtl);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,9 +317,11 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
|
||||
@Override
|
||||
public List<MenuDto> buildTree(List<MenuDto> menuDtos) {
|
||||
menuDtos.sort(Comparator.comparingInt(MenuDto::getMenu_sort));
|
||||
List<MenuDto> trees = new ArrayList<>();
|
||||
Set<String> ids = new HashSet<>();
|
||||
List<MenuDto> collect = menuDtos.stream().filter(a -> a.getType().equals("2")).collect(Collectors.toList());
|
||||
collect.sort(Comparator.comparingInt(MenuDto::getMenu_sort));
|
||||
for (MenuDto menuDTO : collect) {
|
||||
if (menuDTO.getPid() == null) {
|
||||
trees.add(menuDTO);
|
||||
@@ -348,6 +350,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
} else {
|
||||
queryWrapper = new QueryWrapper<SysMenu>().isNull("pid");
|
||||
}
|
||||
queryWrapper.orderByAsc("menu_sort");
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@@ -461,4 +464,4 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
baseMapper.getMenusByRole(systemType,category);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user