add:增加半成品入库功能

This commit is contained in:
2023-04-14 10:09:32 +08:00
parent 3214d73799
commit 16f34a5e3a
34 changed files with 3603 additions and 288 deletions

View File

@@ -59,7 +59,7 @@ public class PageQuery implements Serializable {
pageNum = DEFAULT_PAGE_NUM;
}
Page<T> page = new Page<>(pageNum, pageSize);
if (StringUtils.isNotEmpty(sort)){
if (StringUtils.isNotBlank(sort)){
String[] split = sort.split(",");
for (int i = 0; i < (split.length & ~1); i=i+2) {
String col = split[i];
@@ -79,13 +79,13 @@ public class PageQuery implements Serializable {
pageNum = DEFAULT_PAGE_NUM;
}
Page<T> page = new Page<>(pageNum, pageSize);
if (StringUtils.isNotEmpty(sort)){
if (StringUtils.isNotBlank(sort)){
String[] split = sort.split(",");
for (int i = 0; i < (split.length & ~1); i=i+2) {
String col = split[i];
if ("id".equals(col)){
String mId = mappingId(r);
col = StringUtils.isNotEmpty(mId)?mId:col;
col = StringUtils.isNotBlank(mId)?mId:col;
}
OrderItem item = new OrderItem();
item.setColumn(col);

View File

@@ -32,6 +32,8 @@ public enum AcsTaskEnum {
TASK_PLOTTER_EMPTY("6","刻字机-呼叫空框"),
TASK_WARP_MAC("7","包装机-叫料出库"),
TASK_WARP_EMPTY("8","包装机-送空框"),
TASK_STRUCT_IN("9","入库-生产入库"),
TASK_STRUCT_OUT("10","出库-生产出库"),
//回调状态
STATUS_START("1","执行中"),
@@ -62,6 +64,7 @@ public enum AcsTaskEnum {
AUTO_TASK_FINISHED_TYPE("1", "自动完成任务"),
MANUAL_TASK_FINISHED_TYPE("2", "手动完成任务"),
;
private String code;
private String desc;

View File

@@ -8,7 +8,7 @@ public enum LevelEnum{
WARN,
ERROR;
public static LevelEnum checkLevel(String level){
if (!StringUtils.isEmpty(level)){
if (!StringUtils.isBlank(level)){
for (LevelEnum value : LevelEnum.values()) {
if (value.name().equals(level)){
return value;

View File

@@ -46,7 +46,7 @@ public class DruidFilter extends FilterEventAdapter {
try {
count=statement.getUpdateCount();
}catch (Exception ex){ }
if (StringUtils.isNotEmpty(traceId) && count>0) {
if (StringUtils.isNotBlank(traceId) && count>0) {
if (size > 0) {
Collection<JdbcParameter> values = statement.getParameters().values();
List<Object> params = new ArrayList<>();
@@ -64,7 +64,7 @@ public class DruidFilter extends FilterEventAdapter {
ResultSetProxy rs = super.statement_getResultSet(chain, statement);
String executeSql = statement.getLastExecuteSql();
String traceId = MDC.get("traceId");
if (StringUtils.isNotEmpty(traceId)){
if (StringUtils.isNotBlank(traceId)){
int result = 0;
if (rs != null) {
ResultSetImpl rss = rs.getResultSetRaw().unwrap(ResultSetImpl.class);

View File

@@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.generator.config.GlobalConfig;
import com.baomidou.mybatisplus.generator.config.PackageConfig;
import com.baomidou.mybatisplus.generator.config.StrategyConfig;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import org.springframework.util.StringUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.Scanner;
@@ -26,7 +26,7 @@ public class CodeGenerator {
System.out.println(help.toString());
if (scanner.hasNext()) {
String ipt = scanner.next();
if (!StringUtils.isEmpty(ipt)) {
if (!StringUtils.isBlank(ipt)) {
return ipt;
}
}

View File

@@ -74,10 +74,10 @@ public class EsLogServiceImpl implements EsLogService {
private void extractedParam(LogQuery logQuery, BoolQueryBuilder query) {
if (StringUtils.isNotEmpty(logQuery.getLogLevel())){
if (StringUtils.isNotBlank(logQuery.getLogLevel())){
query.must().add(QueryBuilders.matchQuery("logLevel", LevelEnum.checkLevel(logQuery.getLogLevel())));
}
if (StringUtils.isNotEmpty(logQuery.getSystem())){
if (StringUtils.isNotBlank(logQuery.getSystem())){
query.must().add(QueryBuilders.matchQuery("system", logQuery.getSystem()));
}
if (logQuery.getIsRequest()){
@@ -87,10 +87,10 @@ public class EsLogServiceImpl implements EsLogService {
query.mustNot().add(QueryBuilders.wildcardQuery("logger","org.nl.modules.wql.core.engine.*"));
}
query.mustNot().add(QueryBuilders.matchPhraseQuery("logger","org.elasticsearch.client.RestClient"));
if (StringUtils.isNotEmpty(logQuery.getTraceId())){
if (StringUtils.isNotBlank(logQuery.getTraceId())){
query.must().add(QueryBuilders.matchQuery("traceId", logQuery.getTraceId()));
}
if (StringUtils.isNotEmpty(logQuery.getMessage())){
if (StringUtils.isNotBlank(logQuery.getMessage())){
query.must().add(QueryBuilders.matchPhraseQuery("message", logQuery.getMessage()));
}
if (logQuery.getEndTime()!=null ){
@@ -107,7 +107,7 @@ public class EsLogServiceImpl implements EsLogService {
public void clearLogs(LogQuery logQuery) {
String system = logQuery.getSystem();
BoolQueryBuilder query = QueryBuilders.boolQuery();
if (!StringUtils.isEmpty(system)){
if (!StringUtils.isBlank(system)){
query.must().add(QueryBuilders.matchQuery("system", system));
}
long time = DateUtil.offset(new Date(), DateField.DAY_OF_MONTH, -10).getTime();

View File

@@ -89,13 +89,13 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
if (query.getPid() == null){
query.setPidIsNull(true);
}
if (StringUtils.isNotEmpty(query.getName()) || query.getIsUsed()!=null){
if (StringUtils.isNotBlank(query.getName()) || query.getIsUsed()!=null){
query.setPidIsNull(null);
}
}
Page page = this.page(pageQuery.build(SysDept.class), query.build());
page.setRecords(CopyUtil.copyList(page.getRecords(), DeptVo.class));
if (StringUtils.isNotEmpty(query.getName()) || query.getIsUsed()!=null){
if (StringUtils.isNotBlank(query.getName()) || query.getIsUsed()!=null){
page.getRecords().forEach(a->((DeptVo)a).setHasChildren(false) );
}
return page;
@@ -104,7 +104,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
@Override
public void saveUserDeptRelation(String userId, Collection<String> deptIds) {
if (StringUtils.isEmpty(userId) || CollectionUtils.isEmpty(deptIds)){
if (StringUtils.isBlank(userId) || CollectionUtils.isEmpty(deptIds)){
return;
}
sysDeptMapper.saveDeptRelation(userId,deptIds);
@@ -123,13 +123,13 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
@Override
@Transactional(rollbackFor = Exception.class)
public void updateDept(SysDept dept) {
if (dept == null ||StringUtils.isEmpty(dept.getDeptId())){
if (dept == null ||StringUtils.isBlank(dept.getDeptId())){
return;
}
this.updateById(dept);
//删除节点信息
sysDeptMapper.updateSubCount(dept.getDeptId());
if (StringUtils.isNotEmpty(dept.getPid())){
if (StringUtils.isNotBlank(dept.getPid())){
sysDeptMapper.updateSubCount(dept.getPid());
}
}
@@ -147,14 +147,14 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
for (String deptId : deptIds) {
depts.add(deptId);
String allChild = sysDeptMapper.findAllChild(deptId);
if (StringUtils.isNotEmpty(allChild)){
if (StringUtils.isNotBlank(allChild)){
String[] split = allChild.split(",");
depts.addAll(Arrays.asList(split));
}
}
this.remove(new QueryWrapper<SysDept>().in("dept_id", depts));
deptList.forEach(dept -> {
if (StringUtils.isNotEmpty(dept.getPid())){sysDeptMapper.updateSubCount(dept.getPid());}
if (StringUtils.isNotBlank(dept.getPid())){sysDeptMapper.updateSubCount(dept.getPid());}
});
}
@@ -179,7 +179,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
dept.setCode(UUID.randomUUID().toString());
this.save(dept);
// 清理缓存
if (StringUtils.isNotEmpty(dept.getPid())){
if (StringUtils.isNotBlank(dept.getPid())){
sysDeptMapper.updateSubCount(dept.getPid());
}
}

View File

@@ -61,7 +61,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
@Override
public List query(MenuQuery query, PageQuery page) {
if (StringUtils.isNotEmpty(query.getBlurry())){
if (StringUtils.isNotBlank(query.getBlurry())){
query.setPid(null);
}
Page<SysMenu> menuPage = this.page(page.build(SysMenu.class), query.build());
@@ -171,7 +171,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
baseMapper.untiedMenu(menu.getMenuId());
baseMapper.deleteById(menu.getMenuId());
String pid = menu.getPid();
if (StringUtils.isEmpty(pid)){
if (StringUtils.isBlank(pid)){
pids.add(menu.getMenuId());
}
updateSubCnt(pid);
@@ -189,7 +189,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
String allChild = baseMapper.findAllChild(menuId);
List<String> allChildIds = new ArrayList<>();
allChildIds.add(menuId);
if (StringUtils.isNotEmpty(allChild)){
if (StringUtils.isNotBlank(allChild)){
allChildIds.addAll(Arrays.asList(allChild.split(",")));
}
@@ -205,7 +205,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
if (resources.getPid().equals("0")) {
resources.setPid(null);
if (StringUtils.isNotEmpty(menu.getPid())){
if (StringUtils.isNotBlank(menu.getPid())){
addSystemTypeDict(resources);
}
}else {
@@ -390,7 +390,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
@Override
public List<MenuVo> buildMenus(String systemType) {
Dict dict = sysDictMapper.getOne(new QueryWrapper<Dict>().eq("code", DictConstantPool.DICT_SYS_CODE).eq("value", systemType));
if (dict == null || StringUtils.isEmpty(dict.getPara1())){
if (dict == null || StringUtils.isBlank(dict.getPara1())){
throw new BadRequestException("获取对应的系统菜单不存在");
}
String pid = dict.getPara1();

View File

@@ -138,7 +138,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
@Override
public void saveUserRoleRelation(String user, List<String> roles) {
if (StringUtils.isEmpty(user) || CollectionUtils.isEmpty(roles)){
if (StringUtils.isBlank(user) || CollectionUtils.isEmpty(roles)){
return;
}
roleMapper.saveRoleRelation(user,roles);

View File

@@ -185,7 +185,7 @@ public class ISysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> imp
String oldPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,passVo.getString("oldPass"));
String newPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,passVo.getString("newPass"));
// 解密,得到字符密码
if (StringUtils.isEmpty(oldPass)||StringUtils.isEmpty(newPass)){
if (StringUtils.isBlank(oldPass)||StringUtils.isBlank(newPass)){
throw new BadRequestException("密码不能为空");
}
SysUser user = this.getOne(new QueryWrapper<SysUser>().eq("username", SecurityUtils.getCurrentUsername()));

View File

@@ -26,11 +26,11 @@ public class PointLockUtils {
StringRedisTemplate redisTemplate;
//点位预锁定
public void pointTryLock(String point){
if (StringUtils.isEmpty(point)){
if (StringUtils.isBlank(point)){
throw new BadRequestException("查询不到当前点位NULL");
}
String result = redisTemplate.opsForValue().get(POINT_PRE+point);
if (StringUtils.isNotEmpty(result)){
if (StringUtils.isNotBlank(result)){
throw new BadRequestException("当前点位:"+point+"存在操作,请稍后再试");
}else {
redisTemplate.opsForValue().set(POINT_PRE+point,"1",5, TimeUnit.SECONDS);

View File

@@ -56,7 +56,7 @@ public class AcsToWmsController {
@SaIgnore
public ResponseEntity<Object> receiveTaskIdToCacheLine(@RequestBody JSONObject whereJson) {
//参数校验
if(StringUtils.isEmpty(whereJson.getString("task_code")) || StringUtils.isEmpty(whereJson.getString("position_code"))) {
if(StringUtils.isBlank(whereJson.getString("task_code")) || StringUtils.isBlank(whereJson.getString("position_code"))) {
throw new BizCoreException(ResultCode.VALIDATE_FAILED);
}
return new ResponseEntity<>(acsToWmsService.receiveTaskIdToCacheLine(whereJson), HttpStatus.OK);

View File

@@ -285,7 +285,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
@Override
public void feedcachelineVe(JSONObject param) {
WQLObject positionTab = WQLObject.getWQLObject("sch_cacheline_position");
if (param == null|| StringUtils.isEmpty(param.getString("device_code")) || StringUtils.isEmpty(param.getString("vehicle_code"))){
if (param == null|| StringUtils.isBlank(param.getString("device_code")) || StringUtils.isBlank(param.getString("vehicle_code"))){
return;
}
String cachelineCode = param.getString("device_code");

View File

@@ -84,14 +84,14 @@ public class AgvInstService {
nextPoint = cacheLine.getString("cacheline_code");
//满料请求:查询缓存线空载具列表
cacheVehile = getCacheVehile(nextPoint, null);
if (StringUtils.isEmpty(cacheVehile)) {
if (StringUtils.isBlank(cacheVehile)) {
throw new BadRequestException(OPT_NAME+"缓存线:"+nextPoint+"没有可用空载具");
}
}else {
nextPoint = nextPointList.getJSONObject(0).getString("point_code");
}
}
if (StringUtils.isEmpty(nextPoint)){
if (StringUtils.isBlank(nextPoint)){
throw new BadRequestException(OPT_NAME+"设备:"+point_code+"没有可用点位");
}
task.put("vehicle_code",cacheVehile);
@@ -120,7 +120,7 @@ public class AgvInstService {
//缓存线位置编码 :缺料请求获取缓存线满载具列表
String startPoint = cacheLine.getString("cacheline_code");
String cacheVehile = getCacheVehile(startPoint, material_id);
if (StringUtils.isEmpty(cacheVehile)) {
if (StringUtils.isBlank(cacheVehile)) {
throw new BadRequestException(OPT_NAME+"缓存线:"+startPoint+"没有可用载具");
}
//判断当前物料载具已经任务分配数量:如果>物料已经分配任务。说明满了,不允许再分配
@@ -142,7 +142,7 @@ public class AgvInstService {
WQLObject taskTable = WQLObject.getWQLObject("sch_base_task");
StringBuffer sql = new StringBuffer("vehicle_status = '");
JSONArray runingTask = taskTable.query("point_code2 = '" + cacheLine + "' and task_status < '" + StatusEnum.TASK_FINISH.getCode() + "'").getResultJSONArray(0);
String status = StringUtils.isEmpty(materialId) ? StatusEnum.CACHE_VEL_EMT.getCode() : StatusEnum.CACHE_VEL_FULL.getCode();
String status = StringUtils.isBlank(materialId) ? StatusEnum.CACHE_VEL_EMT.getCode() : StatusEnum.CACHE_VEL_FULL.getCode();
JSONArray result = WQL.getWO("sch_point").addParamMap(MapOf.of("flag", "6", "vehicle_status", status, "material_id", materialId)).process().getResultJSONArray(0);
if (result.size()>0){
if (result.size()>runingTask.size()){

View File

@@ -30,7 +30,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService{
, "start_point_code", task.getString("point_code1")//起点
, "put_point_code", task.getString("point_code2")//到料
, "next_point_code", task.getString("point_code3")//空盘返回点
, "task_group_id", StringUtils.isEmpty(task.getString("task_group_id"))? IdUtil.getStringId():task.getString("task_group_id")
, "task_group_id", StringUtils.isBlank(task.getString("task_group_id"))? IdUtil.getStringId():task.getString("task_group_id")
, "task_type", task.getString("task_type")
, "priority", task.getString("priority")
, "is_send", task.getString("is_send")

View File

@@ -70,7 +70,7 @@ public class CacheLineHandController{
* 输入搜索条件校验,限制查询参数过短,模糊力度大
*/
private void checkLength(String params) {
if(StringUtils.isNotEmpty(params)) {
if(StringUtils.isNotBlank(params)) {
int length = params.getBytes().length;
//限制查询参数过短,模糊力度大
if(Pattern.compile("[0-9a-zA-Z]+").matcher(params).matches() || Pattern.compile("\\d+").matcher(params).matches()) {
@@ -138,7 +138,7 @@ public class CacheLineHandController{
public ResponseEntity<Object> instOperation(@RequestBody JSONObject param) {
log.info("海亮缓存线手持服务 [任务操作] 接口被请求, 请求参数-{}", param);
//任务类型和任务ID校验instruct_uuid为前端参数命名本来应为task_id
if(StringUtils.isEmpty(param.getString("instruct_uuid")) || StringUtils.isEmpty(param.getString("opt_type"))) {
if(StringUtils.isBlank(param.getString("instruct_uuid")) || StringUtils.isBlank(param.getString("opt_type"))) {
throw new BizCoreException("ResultCode.VALIDATE_FAILED");
}
return new ResponseEntity<>(cacheLineHandService.instOperation(param), HttpStatus.OK);
@@ -150,10 +150,10 @@ public class CacheLineHandController{
public ResponseEntity<JSONArray> cacheLineOutBoxExceptionQuery(@RequestBody JSONObject param) {
log.info("海亮缓存线手持服务 [缓存线出箱异常-查询] 接口被请求, 请求参数-{}", param);
//参数校验
if(StringUtils.isEmpty(param.getString("wcsdevice_code"))) {
if(StringUtils.isBlank(param.getString("wcsdevice_code"))) {
throw new BizCoreException("请选择缓存线并输入缓存线位置编号再查询");
}
if(StringUtils.isEmpty(param.getString("position_code"))) {
if(StringUtils.isBlank(param.getString("position_code"))) {
throw new BizCoreException("请输入缓存线位置编号再查询");
}
return new ResponseEntity<>(cacheLineHandService.cacheLineOutBoxExceptionQuery(param), HttpStatus.OK);
@@ -165,10 +165,10 @@ public class CacheLineHandController{
public ResponseEntity<Object> cacheLineOutBoxExceptionConfirm(@RequestBody JSONObject param) {
log.info("海亮缓存线手持服务 [缓存线出箱异常-确认] 接口被请求, 请求参数-{}", param);
//参数校验
if(StringUtils.isEmpty(param.getString("vehicle_code"))) {
if(StringUtils.isBlank(param.getString("vehicle_code"))) {
throw new BizCoreException("请输入料箱码");
}
if(StringUtils.isEmpty(param.getString("wcsdevice_code")) || StringUtils.isEmpty(param.getString("position_code"))) {
if(StringUtils.isBlank(param.getString("wcsdevice_code")) || StringUtils.isBlank(param.getString("position_code"))) {
throw new BizCoreException("请输入缓存线位置编号与缓存线编号");
}
return new ResponseEntity<>(cacheLineHandService.cacheLineOutBoxExceptionConfirm(param), HttpStatus.OK);
@@ -180,7 +180,7 @@ public class CacheLineHandController{
public ResponseEntity<JSONArray> inOutExceptionInstQuery(@RequestBody JSONObject param) {
log.info("海亮缓存线手持服务 [缓存线扫码异常-查询] 接口被·请求, 请求参数-{}", param);
//参数校验
if(StringUtils.isEmpty(param.getString("wcsdevice_code"))) {
if(StringUtils.isBlank(param.getString("wcsdevice_code"))) {
throw new BizCoreException("请选择缓存线编号!");
}
return new ResponseEntity<>(cacheLineHandService.inOutExceptionInstQuery(param), HttpStatus.OK);
@@ -192,7 +192,7 @@ public class CacheLineHandController{
public ResponseEntity<Object> inOutExceptionInstConfirm(@RequestBody JSONObject param) {
log.info("海亮缓存线手持服务 [扫码异常确认] 接口被请求, 请求参数-{}", param);
//参数校验
if(StringUtils.isEmpty(param.getString("type")) || StringUtils.isEmpty(param.getString("wcsdevice_code")) || StringUtils.isEmpty(param.getString("vehicle_code"))) {
if(StringUtils.isBlank(param.getString("type")) || StringUtils.isBlank(param.getString("wcsdevice_code")) || StringUtils.isBlank(param.getString("vehicle_code"))) {
throw new BizCoreException("请确认缓存线,位置,料箱码是否都已选择或填入!");
}
return new ResponseEntity<>(cacheLineHandService.inOutExceptionInstConfirm(param), HttpStatus.OK);
@@ -212,7 +212,7 @@ public class CacheLineHandController{
public ResponseEntity<Object> inOutEmptyBox(@RequestBody JSONObject param) {
log.info("海亮缓存线手持服务 [空箱初始化--出入空箱] 接口被请求, 请求参数-{}", param);
//参数校验
if(StringUtils.isEmpty(param.getString("inOut_type")) || StringUtils.isEmpty(param.getString("wcsdevice_code")) || StringUtils.isEmpty(param.getString("vehicle_code"))) {
if(StringUtils.isBlank(param.getString("inOut_type")) || StringUtils.isBlank(param.getString("wcsdevice_code")) || StringUtils.isBlank(param.getString("vehicle_code"))) {
throw new BizCoreException(ResultCode.VALIDATE_FAILED);
}
return new ResponseEntity<>(cacheLineHandService.inOutEmptyBox(param), HttpStatus.OK);
@@ -291,7 +291,7 @@ public class CacheLineHandController{
public ResponseEntity<Object> cacheLineExcepOpt(@RequestBody JSONObject param) {
log.info("海亮缓存线手持服务 [缓存线异常处理] 接口被请求, 请求参数-{}", param);
//参数校验
if(StringUtils.isEmpty(param.getString("wcsdevice_code")) || StringUtils.isEmpty(param.getString("opt_type"))) {
if(StringUtils.isBlank(param.getString("wcsdevice_code")) || StringUtils.isBlank(param.getString("opt_type"))) {
throw new BizCoreException(ResultCode.VALIDATE_FAILED);
}
return new ResponseEntity<>(cacheLineHandService.cacheLineExcepOpt(param), HttpStatus.OK);

View File

@@ -25,8 +25,6 @@ import org.nl.modules.wql.util.WqlUtil;
import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.pda.dto.MaterialDto;
import org.nl.wms.pda.service.CacheLineHandService;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.tasks.SpeMachineryTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Async;
@@ -77,7 +75,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
// stopWatch.start();
// stopWatch.stop();
// System.out.println("缓存本地花费时间 totalTime = " + stopWatch.getTotalTimeMillis());
if(StringUtils.isEmpty(param)) {
if(StringUtils.isBlank(param)) {
return WQL.getWO("PDA_QUERY").addParam("flag", "6").addParam("condition", param).process().getResultJSONArray(0).toJavaList(MaterialDto.class);
}
List<MaterialDto> materialList;
@@ -117,7 +115,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
*/
@NotNull
private List<MaterialDto> getMaterialDto(List<MaterialDto> materialList, String param) {
if(StringUtils.isNotEmpty(param)) {
if(StringUtils.isNotBlank(param)) {
//按条件搜索
materialList = materialList.stream().filter(m -> (m.getMaterial_name().contains(param)) || m.getMaterial_code().contains(param) || m.getMaterial_spec().contains(param) || m.getClass_name().contains(param)).collect(Collectors.toList());
return materialList;
@@ -277,7 +275,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
@Async
public void cacheLineMaterSync(
String cachelineCode) {
if(StringUtils.isEmpty(cachelineCode)) {
if(StringUtils.isBlank(cachelineCode)) {
return;
}
RedissonUtils.lock(() -> {
@@ -378,7 +376,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
String cacheLine_code = param.getString("wcsdevice_code");
String weight = param.getString("weight");
String quantity = param.getString("quantity");
if(StringUtils.isEmpty(quantity) || param.getInteger("quantity") <= 0) {
if(StringUtils.isBlank(quantity) || param.getInteger("quantity") <= 0) {
throw new BadRequestException("数量必须大于0!");
}
//缓存线位置表
@@ -550,7 +548,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
throw new BadRequestException("未找到该缓存线的点位信息!");
}
//查不到任务信息
if(StringUtils.isEmpty(posiObj.getString("task_code"))) {
if(StringUtils.isBlank(posiObj.getString("task_code"))) {
throw new BadRequestException("未找到该缓存线的点位的任务信息!");
}
JSONArray jsonArray = WQL.getWO("PDA_QUERY").addParam("flag", "10").addParam("task_code", posiObj.getString("task_code")).process().getResultJSONArray(0);
@@ -717,7 +715,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
String wcsdevice_code = param.getString("wcsdevice_code");
WQLObject instructTab = WQLObject.getWQLObject("sch_base_task");
String where = "point_code2 = '" + wcsdevice_code + "' and vehicle_code = '" + vehicle_code + "' and task_status <> '7'";
if(StringUtils.isEmpty(vehicle_code)) {
if(StringUtils.isBlank(vehicle_code)) {
where = "point_code2 = '" + wcsdevice_code + "' and task_status <> '7'";
}
JSONArray arr = instructTab.query(where).getResultJSONArray(0);
@@ -770,7 +768,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
String wcsdevice_code = param.getString("wcsdevice_code");
JSONArray arr;
WQLObject instructTab = WQLObject.getWQLObject("sch_base_task");
if(StringUtils.isEmpty(vehicle_code)) {
if(StringUtils.isBlank(vehicle_code)) {
arr = instructTab.query("point_code1 = '" + wcsdevice_code + "' and task_status <> '7'").getResultJSONArray(0);
}
else{

View File

@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.WQL;
@@ -24,196 +25,201 @@ import java.util.List;
import java.util.Map;
/**
* @description 服务实现
* @author lyd
* @description 服务实现
* @date 2023-03-17
**/
@Service
@RequiredArgsConstructor
@Slf4j
public class RegionServiceImpl implements RegionService {
public class RegionServiceImpl implements RegionService{
@Override
public Map<String,Object> queryAll(Map whereJson, Pageable page) {
String region_code = MapUtil.getStr(whereJson, "region_code");
String product_area = MapUtil.getStr(whereJson, "product_area");
HashMap<String,String> map = new HashMap<>();
map.put("flag", "1");
if(ObjectUtil.isNotEmpty(region_code)) {
map.put("region_code", "%" + region_code + "%");
}
if(ObjectUtil.isNotEmpty(product_area)) {
map.put("product_area", product_area);
}
JSONObject json = WQL.getWO("QSCH_REGION_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "region.region_code ASC");
return json;
}
@Override
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
String region_code = MapUtil.getStr(whereJson, "region_code");
String product_area = MapUtil.getStr(whereJson, "product_area");
@Override
public List<RegionDto> queryAll(Map whereJson) {
WQLObject wo = WQLObject.getWQLObject("sch_base_region");
JSONArray arr = wo.query().getResultJSONArray(0);
if(ObjectUtil.isNotEmpty(arr)) {
return arr.toJavaList(RegionDto.class);
}
return null;
}
HashMap<String, String> map = new HashMap<>();
map.put("flag", "1");
if (ObjectUtil.isNotEmpty(region_code)) map.put("region_code","%" + region_code + "%");
if (ObjectUtil.isNotEmpty(product_area)) map.put("product_area", product_area);
@Override
public RegionDto findByCode(String code) {
WQLObject wo = WQLObject.getWQLObject("sch_base_region");
JSONObject json = wo.query("region_code ='" + code + "'").uniqueResult(0);
if(ObjectUtil.isNotEmpty(json)) {
return json.toJavaObject(RegionDto.class);
}
return null;
}
JSONObject json = WQL.getWO("QSCH_REGION_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "region.region_code ASC");
return json;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void create(RegionDto dto) {
WQLObject wo = WQLObject.getWQLObject("sch_base_region");
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
JSONObject jsonDto = wo.query("region_code = '" + dto.getRegion_code() + "'").uniqueResult(0);
if(ObjectUtil.isNotEmpty(jsonDto)) {
throw new BadRequestException("编码已存在");
}
dto.setCreate_id(currentUserId);
dto.setCreate_name(nickName);
dto.setUpdate_id(currentUserId);
dto.setUpdate_name(nickName);
dto.setUpdate_time(now);
dto.setCreate_time(now);
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
wo.insert(json);
}
@Override
public List<RegionDto> queryAll(Map whereJson) {
WQLObject wo = WQLObject.getWQLObject("sch_base_region");
JSONArray arr = wo.query().getResultJSONArray(0);
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(RegionDto.class);
return null;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(RegionDto dto) {
RegionDto entity = this.findByCode(dto.getRegion_code());
if(entity == null) {
throw new BadRequestException("被删除或无权限,操作失败!");
}
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
dto.setUpdate_time(now);
dto.setUpdate_id(currentUserId);
dto.setUpdate_name(nickName);
WQLObject wo = WQLObject.getWQLObject("sch_base_region");
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
wo.update(json);
}
@Override
public RegionDto findByCode(String code) {
WQLObject wo = WQLObject.getWQLObject("sch_base_region");
JSONObject json = wo.query("region_code ='" + code + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(json)) {
return json.toJavaObject(RegionDto.class);
}
return null;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteAll(String[] codes) {
WQLObject wo = WQLObject.getWQLObject("sch_base_region");
for(String region_code : codes) {
wo.delete("region_code ='" + region_code + "'");
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void create(RegionDto dto) {
WQLObject wo = WQLObject.getWQLObject("sch_base_region");
/**
* 获取点位状态下拉框
*
* @param region_code
* @return
*/
@Override
public JSONArray getPointStatusSelectByCode(String region_code) {
/**
* label,value
*/
JSONArray res = new JSONArray();
String point_status_explain = findByCode(region_code).getPoint_status_explain();
if(ObjectUtil.isEmpty(point_status_explain)) {
return res;
}
String[] explain = point_status_explain.split("");
for(int i = 0; i < explain.length; i++) {
String[] status = explain[i].split("-");
JSONObject point_status = new JSONObject();
point_status.put("label", status[1]);
point_status.put("value", status[0]);
res.add(point_status);
}
return res;
}
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
/**
* 获取点位类型下拉框
*
* @param region_code
* @return
*/
@Override
public JSONArray getPointTypeSelectByCode(String region_code) {
/**
* label,value
*/
JSONArray res = new JSONArray();
String point_type_explain = findByCode(region_code).getPoint_type_explain();
if(ObjectUtil.isEmpty(point_type_explain)) {
return res;
}
String[] explain = point_type_explain.split("");
for(int i = 0; i < explain.length; i++) {
String[] types = explain[i].split("-");
JSONObject point_type = new JSONObject();
point_type.put("label", types[1]);
point_type.put("value", types[0]);
res.add(point_type);
}
return res;
}
JSONObject jsonDto = wo.query("region_code = '" + dto.getRegion_code() + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonDto)) throw new BadRequestException("编码已存在");
dto.setCreate_id(currentUserId);
dto.setCreate_name(nickName);
dto.setUpdate_id(currentUserId);
dto.setUpdate_name(nickName);
dto.setUpdate_time(now);
dto.setCreate_time(now);
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
wo.insert(json);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(RegionDto dto) {
RegionDto entity = this.findByCode(dto.getRegion_code());
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
dto.setUpdate_time(now);
dto.setUpdate_id(currentUserId);
dto.setUpdate_name(nickName);
WQLObject wo = WQLObject.getWQLObject("sch_base_region");
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
wo.update(json);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteAll(String[] codes) {
WQLObject wo = WQLObject.getWQLObject("sch_base_region");
for (String region_code : codes) {
wo.delete("region_code ='" + region_code + "'");
}
}
/**
* 获取点位状态下拉框
*
* @param region_code
* @return
*/
@Override
public JSONArray getPointStatusSelectByCode(String region_code) {
/**
* label,value
*/
JSONArray res = new JSONArray();
String point_status_explain = findByCode(region_code).getPoint_status_explain();
if (ObjectUtil.isEmpty(point_status_explain)) return res;
String[] explain = point_status_explain.split("");
for (int i = 0; i < explain.length; i++) {
String[] status = explain[i].split("-");
JSONObject point_status = new JSONObject();
point_status.put("label", status[1]);
point_status.put("value", status[0]);
res.add(point_status);
}
return res;
}
/**
* 获取点位类型下拉框
*
* @param region_code
* @return
*/
@Override
public JSONArray getPointTypeSelectByCode(String region_code) {
/**
* label,value
*/
JSONArray res = new JSONArray();
String point_type_explain = findByCode(region_code).getPoint_type_explain();
if (ObjectUtil.isEmpty(point_type_explain)) return res;
String[] explain = point_type_explain.split("");
for (int i = 0; i < explain.length; i++) {
String[] types = explain[i].split("-");
JSONObject point_type = new JSONObject();
point_type.put("label", types[1]);
point_type.put("value", types[0]);
res.add(point_type);
}
return res;
}
@Override
public JSONObject getRegionSelect(JSONObject whereJson) {
String stor_id = whereJson.getString("stor_id");
JSONArray prodArr = WQL.getWO("QSCH_REGION_01").addParam("flag", "2").addParam("value",stor_id).process().getResultJSONArray(0);
JSONArray new_ja = new JSONArray();
for (int i = 0; i < prodArr.size(); i++) {
JSONObject json = prodArr.getJSONObject(i);
JSONObject jsonMst = new JSONObject();
jsonMst.put("value",json.getString("value"));
jsonMst.put("label",json.getString("label"));
// 查询子类
JSONArray DtlArr = WQL.getWO("QSCH_REGION_01").addParam("flag", "3").addParam("product_area", json.getString("value")).process().getResultJSONArray(0);
if (DtlArr.size() > 0) {
JSONArray sect_ja = new JSONArray();
for (int j = 0; j < DtlArr.size(); j++) {
JSONObject json2 = DtlArr.getJSONObject(j);
JSONObject sect_cas = new JSONObject();
sect_cas.put("value", json2.getString("region_code"));
sect_cas.put("label", json2.getString("region_name"));
sect_ja.add(sect_cas);
}
jsonMst.put("children", sect_ja);
}
new_ja.add(jsonMst);
}
JSONObject jo = new JSONObject();
jo.put("content", new_ja);
return jo;
}
@Override
public Map<String, Object> getPointQuery(Map whereJson, Pageable page) {
String product_area = MapUtil.getStr(whereJson, "stor_id"); // 生产区域
String region_code = MapUtil.getStr(whereJson, "sect_id"); // 所属区域
String point_code = MapUtil.getStr(whereJson, "point_code");
JSONObject map = new JSONObject();
map.put("flag", "4");
map.put("product_area",product_area);
map.put("region_code",region_code);
if (ObjectUtil.isNotEmpty(point_code)) map.put("point_code","%"+point_code+"%");
JSONObject jsonObject = WQL.getWO("QSCH_REGION_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "point.point_code ASC");
return jsonObject;
}
@Override
public JSONObject getRegionSelect(JSONObject whereJson) {
JSONObject jo = new JSONObject();
String stor_id = whereJson.getString("stor_id");
//库区作为区域
if(StringUtils.isBlank(stor_id)) {
JSONArray jsonArray =WQLObject.getWQLObject("st_ivt_sectattr").query("is_used = '" + 1 + "' and is_delete = '0'").getResultJSONArray(0);
jo.put("content", jsonArray);
return jo;
}
JSONArray prodArr = WQL.getWO("QSCH_REGION_01").addParam("flag", "2").addParam("value", stor_id).process().getResultJSONArray(0);
JSONArray new_ja = new JSONArray();
for(int i = 0; i < prodArr.size(); i++) {
JSONObject json = prodArr.getJSONObject(i);
JSONObject jsonMst = new JSONObject();
jsonMst.put("value", json.getString("value"));
jsonMst.put("label", json.getString("label"));
// 查询子类
JSONArray DtlArr = WQL.getWO("QSCH_REGION_01").addParam("flag", "3").addParam("product_area", json.getString("value")).process().getResultJSONArray(0);
if(DtlArr.size() > 0) {
JSONArray sect_ja = new JSONArray();
for(int j = 0; j < DtlArr.size(); j++) {
JSONObject json2 = DtlArr.getJSONObject(j);
JSONObject sect_cas = new JSONObject();
sect_cas.put("value", json2.getString("region_code"));
sect_cas.put("label", json2.getString("region_name"));
sect_ja.add(sect_cas);
}
jsonMst.put("children", sect_ja);
}
new_ja.add(jsonMst);
}
jo.put("content", new_ja);
return jo;
}
@Override
public Map<String,Object> getPointQuery(Map whereJson, Pageable page) {
String product_area = MapUtil.getStr(whereJson, "stor_id"); // 生产区域
String region_code = MapUtil.getStr(whereJson, "sect_id"); // 所属区域
String point_code = MapUtil.getStr(whereJson, "point_code");
JSONObject map = new JSONObject();
map.put("flag", "4");
map.put("product_area", product_area);
map.put("region_code", region_code);
if(ObjectUtil.isNotEmpty(point_code)) {
map.put("point_code", "%" + point_code + "%");
}
JSONObject jsonObject = WQL.getWO("QSCH_REGION_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "point.point_code ASC");
return jsonObject;
}
}

View File

@@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSONObject;
import org.nl.common.enums.StatusEnum;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.system.util.CodeUtil;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.system.service.param.impl.SysParamServiceImpl;
@@ -172,11 +173,14 @@ public class ProductInTask extends AbstractAcsTask {
JSONObject json = new JSONObject();
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
json.put("task_code", IdUtil.getSnowflake(1,1).nextId());
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
json.put("product_area", form.getString("product_area"));
json.put("task_type", form.getString("task_type"));
json.put("task_name", form.getString("task_name"));
json.put("is_send", "1");
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
json.put("material_id", form.getString("material_id"));
json.put("material_qty", form.getString("plan_qty"));
json.put("point_code1", start_device_code);
json.put("point_code2", next_device_code);
json.put("vehicle_code", form.getString("vehicle_code"));
@@ -188,7 +192,6 @@ public class ProductInTask extends AbstractAcsTask {
json.put("update_name", currentUsername);
json.put("update_time", DateUtil.now());
WQLObject.getWQLObject("SCH_BASE_Task").insert(json);
return json.getString("task_id");
}

View File

@@ -78,7 +78,7 @@ public class WashMachineryTask extends AbstractAcsTask {
Assert.notEmpty(new Object[]{param,param.getString("workorder_id")},"参数不能为空");
String inDevices = param.getString("in_devices");
String workorderId = param.getString("workorder_id");
if (!StringUtils.isEmpty(inDevices)){
if (!StringUtils.isBlank(inDevices)){
String sql = Arrays.stream(inDevices.split(",")).collect(Collectors.joining("','"));
//跟新工单:状态为完成;跟新点位 material_id is not null and point_status = '2'
pointTab.update(MapOf.of("material_id","","point_status","1"),"point_code in ('"+sql+"')");

View File

@@ -0,0 +1,188 @@
package org.nl.wms.st.in.rest;
import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.nl.common.anno.Log;
import org.nl.common.utils.api.ResultCode;
import org.nl.modules.common.exception.BizCoreException;
import org.nl.wms.st.in.service.ProductInService;
import org.nl.wms.st.in.service.SemiProductInService;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
@RestController
@RequiredArgsConstructor
@Api(tags = "半成品入库")
@RequestMapping("/api/in/semiProductIn")
@Slf4j
@SaIgnore
public class SemiProductInController{
private final SemiProductInService semiProductInService;
@GetMapping
@Log("查询入库单据")
@ApiOperation("查询入库单据")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(semiProductInService.pageQuery(whereJson, page), HttpStatus.OK);
}
@Log("删除出入库单")
@ApiOperation("删除出入库单")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
semiProductInService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
@GetMapping("/getBillDtl")
@Log("查询入库单来源")
@ApiOperation("查询入库单来源")
public ResponseEntity<Object> getBillDtl(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(semiProductInService.getBillDtl(whereJson, page), HttpStatus.OK);
}
@PostMapping()
@Log("新增入库单")
@ApiOperation("新增入库单")
public ResponseEntity<Object> insertDtl(@RequestBody JSONObject whereJson) {
semiProductInService.insertDtl(whereJson);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@PostMapping("/semiProductInFromPda")
@Log("C端半成品入库")
@ApiOperation("C端入库")
public ResponseEntity<Object> semiProductInFromPda(@RequestBody JSONObject whereJson) {
log.info("海亮缓存线手持服务 [半成品入库] 接口被请求, 请求参数-{}", whereJson);
//参数校验
if(StringUtils.isBlank(whereJson.getString("iostorinv_id")) || StringUtils.isBlank(whereJson.getString("material_id")) || StringUtils.isBlank(whereJson.getString("plan_qty")) || StringUtils.isBlank(whereJson.getString("storagevehicle_code"))) {
throw new BizCoreException(ResultCode.VALIDATE_FAILED);
}
return new ResponseEntity<>(semiProductInService.semiProductInFromPda(whereJson), HttpStatus.OK);
}
@PutMapping
@Log("修改入库单")
@ApiOperation("修改入库单")
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson) {
semiProductInService.update(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/queryStor")
@Log("查询仓库")
@ApiOperation("查询仓库")
public ResponseEntity<Object> queryStor() {
return new ResponseEntity<>(semiProductInService.queryStor(), HttpStatus.OK);
}
@PostMapping("/getIODtl")
@Log("查询出入库单明细")
@ApiOperation("查询出入库单明细")
public ResponseEntity<Object> getIODtl(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(semiProductInService.getIODtl(whereJson), HttpStatus.OK);
}
@PostMapping("/commit")
@Log("出入单提交")
@ApiOperation("出入单提交")
public ResponseEntity<Object> commit(@RequestBody Map whereJson) {
semiProductInService.commit(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/getDisDtl")
@Log("查询入库分配明细")
@ApiOperation("查询入库分配明细")
public ResponseEntity<Object> getDisDtl(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(semiProductInService.getDisDtl(whereJson), HttpStatus.OK);
}
@PostMapping("/confirmvehicle")
@Log("组盘确认")
@ApiOperation("组盘确认")
public ResponseEntity<Object> confirmvehicle(@RequestBody JSONObject whereJson) {
semiProductInService.confirmvehicle(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/divStruct")
@Log("分配货位")
@ApiOperation("分配货位")
public ResponseEntity<Object> divStruct(@RequestBody JSONObject whereJson) {
semiProductInService.divStruct(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/unDivStruct")
@Log("取消分配货位")
@ApiOperation("取消分配货位")
public ResponseEntity<Object> unDivStruct(@RequestBody JSONObject whereJson) {
semiProductInService.unDivStruct(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/divPoint")
@Log("设置起点")
@ApiOperation("设置起点")
public ResponseEntity<Object> divPoint(@RequestBody JSONObject whereJson) {
semiProductInService.divPoint(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/delDis")
@Log("删除分配")
@ApiOperation("删除分配")
public ResponseEntity<Object> delDis(@RequestBody JSONObject whereJson) {
semiProductInService.delDis(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/queryBoxMater")
@Log("查询箱内子卷")
@ApiOperation("查询箱内子卷")
public ResponseEntity<Object> queryBoxMater(@RequestBody JSONArray whereJson) {
return new ResponseEntity<>(semiProductInService.queryBoxMater(whereJson), HttpStatus.OK);
}
@PostMapping("/updateTask")
@Log("变更任务")
@ApiOperation("变更任务")
public ResponseEntity<Object> updateTask(@RequestBody Map whereJson) {
semiProductInService.updateTask(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/confirm")
@Log("完成单据")
@ApiOperation("完成单据")
public ResponseEntity<Object> confirm(@RequestBody Map whereJson) {
semiProductInService.confirm(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/autoDis")
@Log("自动分配")
@ApiOperation("自动分配")
public ResponseEntity<Object> autoDis(@RequestBody JSONObject whereJson) {
semiProductInService.autoDis(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/getDisTask")
@Log("获取明细任务")
@ApiOperation("获取明细任务")
public ResponseEntity<Object> getDisTask(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(semiProductInService.getDisTask(whereJson), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,127 @@
package org.nl.wms.st.in.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.nl.common.utils.api.CommonResult;
import org.springframework.data.domain.Pageable;
import java.util.Map;
public interface SemiProductInService{
/**
* 查询数据分页
*
* @param whereJson 条件
* @param page 分页参数
* @return Map<String, Object>
*/
Map<String,Object> pageQuery(Map whereJson, Pageable page);
Map<String,Object> getBillDtl(Map whereJson, Pageable page);
/**
* 新增单据
*
* @param whereJson /
* @return iostorinv_id
*/
String insertDtl(JSONObject whereJson);
/**
* C端半成品入库
*
* @param whereJson /
* @return 操作结果
*/
CommonResult<Integer> semiProductInFromPda(JSONObject whereJson);
/**
* 删除单据
*
* @param ids /
*/
void deleteAll(Long[] ids);
void delDis(JSONObject whereJson);
JSONArray queryBoxMater(JSONArray rows);
/**
* 修改单据
*
* @param whereJson /
*/
void update(JSONObject whereJson);
void commit(Map whereJson);
/**
* 查询出入库单明细
*
* @param whereJson /
* @return JSONArray
*/
JSONArray getIODtl(JSONObject whereJson);
/**
* 分配货位
*
* @param whereJson /
*/
void divStruct(JSONObject whereJson);
/**
* 取消分配
*
* @param whereJson /
*/
void unDivStruct(JSONObject whereJson);
/**
* 设置起点
*
* @param whereJson /
*/
void divPoint(JSONObject whereJson);
void updateTask(Map whereJson);
void confirm(Map whereJson);
/**
* 查询入库分配明细
*
* @param whereJson /
* @return JSONArray
*/
JSONArray getDisDtl(JSONObject whereJson);
/**
* 自动分配
*
* @param whereJson /
* @return JSONObject
*/
JSONObject autoDis(JSONObject whereJson);
/**
* 查询仓库
*
* @return JSONArray
*/
JSONArray queryStor();
/**
* 组盘确认
*
* @param whereJson /
*/
void confirmvehicle(JSONObject whereJson);
/**
* 获取分配明细任务
*
* @param whereJson /
*/
JSONArray getDisTask(JSONObject whereJson);
}

View File

@@ -60,7 +60,6 @@ public class ProductInServiceImpl implements ProductInService {
String begin_time = MapUtil.getStr(whereJson, "begin_time");
String end_time = MapUtil.getStr(whereJson, "end_time");
String bill_status = MapUtil.getStr(whereJson, "bill_status");
String bill_type = MapUtil.getStr(whereJson, "bill_type");
JSONObject map = new JSONObject();
map.put("flag", "1");
@@ -68,7 +67,7 @@ public class ProductInServiceImpl implements ProductInService {
map.put("begin_time",begin_time);
map.put("end_time",end_time);
map.put("bill_status",bill_status);
map.put("bill_type",bill_type);
map.put("bill_type", "0001");
if (ObjectUtil.isNotEmpty(bill_code)) map.put("bill_code","%"+bill_code+"%");
JSONObject jo = WQL.getWO("QST_IVT_PRODUCTIN_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "input_time desc");
@@ -137,11 +136,11 @@ public class ProductInServiceImpl implements ProductInService {
io_mst.put("detail_count", rows.size());
io_mst.put("remark", whereJson.get("remark"));
io_mst.put("bill_status", whereJson.getString("bill_status"));
io_mst.put("input_optid", currentUserId + "");
io_mst.put("input_optname", nickName);
io_mst.put("input_id", currentUserId + "");
io_mst.put("input_name", nickName);
io_mst.put("input_time", now);
io_mst.put("update_optid", currentUserId + "");
io_mst.put("update_optname", nickName);
io_mst.put("update_id", currentUserId + "");
io_mst.put("update_name", nickName);
io_mst.put("update_time", now);
io_mst.put("is_delete", "0");
@@ -198,8 +197,8 @@ public class ProductInServiceImpl implements ProductInService {
JSONObject param = new JSONObject();
param.put("iostorinv_id", String.valueOf(id));
param.put("is_delete", "1");
param.put("update_optid", currentUserId);
param.put("update_optname", nickName);
param.put("update_id", currentUserId);
param.put("update_name", nickName);
param.put("update_time", now);
wo.update(param);
}
@@ -265,8 +264,8 @@ public class ProductInServiceImpl implements ProductInService {
io_mst.put("product_name", json.getString("label"));
io_mst.put("detail_count", rows.size());
io_mst.put("remark", whereJson.get("remark"));
io_mst.put("update_optid", currentUserId + "");
io_mst.put("update_optname", nickName);
io_mst.put("update_id", currentUserId + "");
io_mst.put("update_name", nickName);
io_mst.put("update_time", now);
for (int i = 0; i < rows.size(); i++) {
@@ -322,8 +321,8 @@ public class ProductInServiceImpl implements ProductInService {
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
map.put("update_optid", currentUserId + "");
map.put("update_optname", nickName);
map.put("update_id", currentUserId + "");
map.put("update_name", nickName);
map.put("update_time", now);
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(map, "iostorinv_id = '" + iostorinv_id + "'");
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").update(map, "iostorinv_id = '" + iostorinv_id + "'");
@@ -477,14 +476,14 @@ public class ProductInServiceImpl implements ProductInService {
JSONArray dtl_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinv_id = '" + dis_jo.getString("iostorinv_id") + "' AND bill_status < '30'").getResultJSONArray(0);
if (dtl_rows.size() == 0) {
mst.put("bill_status", "30");
mst.put("dis_optid", currentUserId);
mst.put("dis_optname", nickName);
mst.put("dis_id", currentUserId);
mst.put("dis_name", nickName);
mst.put("dis_time", now);
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(mst);
} else {
mst.put("bill_status", "20");
mst.put("dis_optid", currentUserId);
mst.put("dis_optname", nickName);
mst.put("dis_id", currentUserId);
mst.put("dis_name", nickName);
mst.put("dis_time", now);
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(mst);
}
@@ -999,8 +998,8 @@ public class ProductInServiceImpl implements ProductInService {
}
mst_jo.put("bill_status", "99");
mst_jo.put("confirm_optid", currentUserId);
mst_jo.put("confirm_optname", nickName);
mst_jo.put("confirm_id", currentUserId);
mst_jo.put("confirm_name", nickName);
mst_jo.put("confirm_time", now);
//更新主表状态为99

View File

@@ -8,6 +8,7 @@ import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.WQL;
@@ -30,11 +31,22 @@ public class StorPublicServiceImpl implements StorPublicService {
void createStor(JSONObject from) {
// 货位库存表
WQLObject wql_StructIvt = WQLObject.getWQLObject("ST_IVT_StructIvt");
// 查询货位信息
JSONObject jo = WQL.getWO("ST_PUB_QUERY_01")
.addParam("flag", "1")
.addParam("id", from.getString("struct_id"))
.process().uniqueResult(0);
JSONObject jo;
// 查询货位信息,半成品找仓位信息
if(StringUtils.isNotBlank(from.getString("isStructAttr")))
{
jo = WQL.getWO("ST_PUB_QUERY_01")
.addParam("flag", "5")
.addParam("id", from.getString("struct_id"))
.process().uniqueResult(0);
}
else
{
jo = WQL.getWO("ST_PUB_QUERY_01")
.addParam("flag", "1")
.addParam("id", from.getString("struct_id"))
.process().uniqueResult(0);
}
if (jo == null) {
throw new BadRequestException("点位不存在或者未启用:" + from.getString("struct_id"));
}
@@ -48,15 +60,17 @@ public class StorPublicServiceImpl implements StorPublicService {
throw new BadRequestException("物料不存在或者未启用:" + from.getString("material_id"));
}
from.put("stockrecord_id", IdUtil.getSnowflake(1, 1).nextId() + "");
from.put("struct_code", jo.getString("point_code"));
from.put("struct_name", jo.getString("point_name"));
from.put("product_area", jo.getString("product_area"));
from.put("instorage_time", DateUtil.now());
wql_StructIvt.insert(from);
// 更新库存变动日志
from.put("result_qty", from.getDoubleValue("ivt_qty"));
from.put("stor_code", jo.getString("stor_code"));
// this.createStructIvtFlow(from);
//this.createStructIvtFlow(from);
}
@Transactional(rollbackFor = Exception.class)
@@ -153,6 +167,7 @@ public class StorPublicServiceImpl implements StorPublicService {
@Override
@Transactional(rollbackFor = Exception.class)
public void IOStor(JSONObject from, String change_type_scode) {
// 仓位库存表
WQLObject wql = WQLObject.getWQLObject("ST_IVT_StructIvt");
String struct_id_In = "";
@@ -161,6 +176,7 @@ public class StorPublicServiceImpl implements StorPublicService {
String storagevehicle_code = from.getString("storagevehicle_code");
String quality_scode_In = "";
double change_qty = 0;
JSONObject jo;
if (ObjectUtil.isEmpty(from)) {
throw new BadRequestException("输入from异常请检查");
}
@@ -418,11 +434,21 @@ public class StorPublicServiceImpl implements StorPublicService {
jo_in.put("bill_code", from.getString("bill_code"));
jo_in.put("bill_table", from.getString("bill_table"));
jo_in.put("change_qty", from.getString("change_qty"));
// 查询货位信息
JSONObject jo = WQL.getWO("ST_PUB_QUERY_01")
.addParam("flag", "1")
.addParam("id", from.getString("struct_id"))
.process().uniqueResult(0);
// 查询货位信息,半成品找仓位信息
if(StringUtils.isNotBlank(from.getString("isStructAttr")))
{
jo = WQL.getWO("ST_PUB_QUERY_01")
.addParam("flag", "5")
.addParam("id", from.getString("struct_id"))
.process().uniqueResult(0);
}
else
{
jo = WQL.getWO("ST_PUB_QUERY_01")
.addParam("flag", "1")
.addParam("id", from.getString("struct_id"))
.process().uniqueResult(0);
}
if (jo == null) {
throw new BadRequestException("仓位不存在或者未启用:" + from.getString("struct_id"));
}

View File

@@ -0,0 +1,166 @@
package org.nl.wms.st.out.rest;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.anno.Log;
import org.nl.wms.st.out.service.ProductOutService;
import org.nl.wms.st.out.service.SemiProductOutService;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@RestController
@RequiredArgsConstructor
@Api(tags = "半成品出库")
@RequestMapping("/api/semiProductOut")
@Slf4j
public class SemiProductOutController{
private final SemiProductOutService semiProductOutService;
@GetMapping
@Log("查询出库单")
@ApiOperation("查询出库单")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
return new ResponseEntity<>(semiProductOutService.pageQuery(whereJson,page), HttpStatus.OK);
}
@GetMapping("/addDtl")
@Log("查询库存")
@ApiOperation("查询库存")
public ResponseEntity<Object> queryAddDtl(@RequestParam Map whereJson, Pageable page){
return new ResponseEntity<>(semiProductOutService.queryAddDtl(whereJson,page), HttpStatus.OK);
}
@GetMapping("/queryDtl")
@Log("查询明细")
@ApiOperation("查询明细")
public ResponseEntity<Object> queryDtl(@RequestParam Map whereJson, Pageable page){
return new ResponseEntity<>(semiProductOutService.queryDtl(whereJson,page), HttpStatus.OK);
}
@PostMapping("/getOutBillDtl")
@Log("查询分配明细")
@ApiOperation("查询分配明细")
public ResponseEntity<Object> getOutBillDtl(@RequestBody JSONObject whereJson){
return new ResponseEntity<>(semiProductOutService.getOutBillDtl(whereJson), HttpStatus.OK);
}
@Log("删除出库单")
@ApiOperation("删除出库单")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
semiProductOutService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
@PutMapping
@Log("修改出库单")
@ApiOperation("修改出库单")
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson){
semiProductOutService.update(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping()
@Log("新增出库单")
@ApiOperation("新增出库单")
public ResponseEntity<Object> insertDtl(@RequestBody JSONObject whereJson){
semiProductOutService.insertDtl(whereJson);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@PostMapping("/allDiv")
@Log("出库单全部分配")
@ApiOperation("出库单全部分配")
public ResponseEntity<Object> allDiv(@RequestBody JSONObject whereJson) {
semiProductOutService.allDiv(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/allDivOne")
@Log("分配一条出库明细")
@ApiOperation("分配一条出库明细")
public ResponseEntity<Object> allDivOne(@RequestBody JSONObject whereJson) {
semiProductOutService.allDivOne(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/allCancel")
@Log("出库单全部取消")
@ApiOperation("出库单全部取消")
public ResponseEntity<Object> allCancel(@RequestBody JSONObject whereJson) {
semiProductOutService.allCancel(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/oneCancel")
@Log("出库单全部取消")
@ApiOperation("出库单全部取消")
public ResponseEntity<Object> oneCancel(@RequestBody JSONObject whereJson) {
semiProductOutService.oneCancel(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/getOutBillDis")
@Log("查询出库单分配明细")
@ApiOperation("查询出库单分配明细")
public ResponseEntity<Object> getOutBillDis(@RequestBody JSONObject whereJson){
return new ResponseEntity<>(semiProductOutService.getOutBillDis(whereJson), HttpStatus.OK);
}
@PostMapping("/allSetPoint")
@Log("设置全部站点")
@ApiOperation("设置全部站点")
public ResponseEntity<Object> allSetPoint(@RequestBody JSONObject whereJson) {
semiProductOutService.allSetPoint(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/manualDiv")
@Log("出库单手动分配")
@ApiOperation("出库单手动分配")
public ResponseEntity<Object> manualDiv(@RequestBody JSONObject whereJson) {
semiProductOutService.manualDiv(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/confirm")
@Log("出库单强制确认")
@ApiOperation("出库单强制确认")
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
semiProductOutService.confirm(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/finishTask")
@Log("出库任务手动完成")
@ApiOperation("出库任务手动完成")
public ResponseEntity<Object> finishTask(@RequestBody JSONObject whereJson) {
semiProductOutService.finishTask(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/backConfirm")
@Log("出库单强制确认")
@ApiOperation("出库单强制确认")
public ResponseEntity<Object> backConfirm(@RequestBody JSONObject whereJson) {
semiProductOutService.backConfirm(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Log("下载发货单Excel")
@ApiOperation("下载发货单Excel")
@GetMapping(value = "/downloadExcel")
public ResponseEntity<Object> downloadExcel(HttpServletResponse response, @RequestParam Map whereJson) throws IOException {
semiProductOutService.downloadExcel(response,whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@@ -0,0 +1,121 @@
package org.nl.wms.st.out.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.springframework.data.domain.Pageable;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
public interface SemiProductOutService{
/**
* 查询数据分页
*
* @param whereJson 条件
* @param page 分页参数
* @return Map<String, Object>
*/
Map<String, Object> pageQuery(Map whereJson, Pageable page);
/**
* 查询库存数据
*
* @param whereJson 条件
* @param page 分页参数
* @return Map<String, Object>
*/
Map<String, Object> queryAddDtl(Map whereJson, Pageable page);
/**
* 查询明细
*
* @param whereJson 条件
* @param page 分页参数
* @return Map<String, Object>
*/
Map<String, Object> queryDtl(Map whereJson, Pageable page);
/**
* 多选删除
* @param ids /
*/
void deleteAll(Long[] ids);
/**
* 新增出库单
* @param whereJson
* 参数举例:
* {bill_code=, stor_id=1473161852946092032, stor_code=01, stor_name=原材料库, bill_status=10, total_qty=2, detail_count=1, bill_type=010201, remark=, biz_date=2022-01-08, create_mode=, tableData=[{material_id=1309, material_code=090301010001, bill_status=10, material_name=碳化钨粉 02, pcsn=, quality_scode=02, ivt_level=01, is_active=1, plan_qty=2, qty_unit_name=千克\公斤, qty_unit_id=1, remark=, edit=true}]}
* /
*/
String insertDtl (JSONObject whereJson);
/**
* 查询出库单明细
* @param whereJson /
* @return JSONArray
*/
JSONArray getOutBillDtl(JSONObject whereJson);
/**
* 查询出库单分配明细
* @param whereJson /
* @return
*/
JSONArray getOutBillDis(JSONObject whereJson);
/**
* 修改出库单
* @param whereJson /
*/
void update(JSONObject whereJson);
/**
* 全部分配,对同一出库单明细进行分配
* @param whereJson /
*/
void allDiv(JSONObject whereJson);
/**
* 分配一条出库明细
* @param whereJson /
*/
void allDivOne(JSONObject whereJson);
/**
* 全部取消
* @param whereJson /
*/
void allCancel(JSONObject whereJson);
/**
* 取消一个
* @param whereJson /
*/
void oneCancel(JSONObject whereJson);
/**
* 设置全部站点
* @param whereJson /
*/
void allSetPoint(JSONObject whereJson);
/**
* 出库单手动分配
* @param whereJson /
*/
void manualDiv(JSONObject whereJson);
/**
* 出库单强制确认
* @param whereJson /
*/
void confirm(JSONObject whereJson);
/**
* 出库任务手动完成
* @param whereJson /
*/
void finishTask(JSONObject whereJson);
/**
* 出库单强制确认
* @param whereJson /
*/
void backConfirm(JSONObject whereJson);
/**
* 下载发货单Excel
* @param whereJson /
*/
void downloadExcel(HttpServletResponse response, Map whereJson) throws IOException;
}

View File

@@ -52,9 +52,9 @@ public class ProductOutServiceImpl implements ProductOutService {
JSONObject map = new JSONObject();
map.put("flag", "1");
map.put("bill_type","1001");
map.put("product_code",MapUtil.getStr(whereJson,"product_code"));
map.put("bill_status",MapUtil.getStr(whereJson,"bill_status"));
map.put("bill_type",MapUtil.getStr(whereJson,"bill_type"));
map.put("begin_time",MapUtil.getStr(whereJson, "begin_time"));
map.put("end_time",MapUtil.getStr(whereJson, "end_time"));
@@ -133,8 +133,8 @@ public class ProductOutServiceImpl implements ProductOutService {
for (Long iostorinv_id : ids) {
HashMap<String, String> map = new HashMap<>();
map.put("is_delete", "1");
map.put("update_optid", currentUserId + "");
map.put("update_optname", nickName);
map.put("update_id", currentUserId + "");
map.put("update_name", nickName);
map.put("update_time", now);
wo.update(map, "iostorinv_id='" + iostorinv_id + "'");
}
@@ -165,11 +165,11 @@ public class ProductOutServiceImpl implements ProductOutService {
jsonMst.put("detail_count", array.size() + "");
jsonMst.put("bill_status", "10");
jsonMst.put("remark", map.getString("remark"));
jsonMst.put("input_optid", currentUserId + "");
jsonMst.put("input_optname", nickName);
jsonMst.put("input_id", currentUserId + "");
jsonMst.put("input_name", nickName);
jsonMst.put("input_time", now);
jsonMst.put("update_optid", currentUserId + "");
jsonMst.put("update_optname", nickName);
jsonMst.put("update_id", currentUserId + "");
jsonMst.put("update_name", nickName);
jsonMst.put("update_time", now);
jsonMst.put("is_delete", "0");
@@ -246,8 +246,8 @@ public class ProductOutServiceImpl implements ProductOutService {
jsonMst.put("product_name", jsonArea.getString("label"));
jsonMst.put("detail_count", array.size() + "");
jsonMst.put("remark", whereJson.getString("remark"));
jsonMst.put("update_optid", currentUserId + "");
jsonMst.put("update_optname", nickName);
jsonMst.put("update_id", currentUserId + "");
jsonMst.put("update_name", nickName);
jsonMst.put("update_time", now);
// 删除明细
@@ -1025,8 +1025,8 @@ public class ProductOutServiceImpl implements ProductOutService {
HashMap<String, String> map_mst = new HashMap<>();
map_mst.put("bill_status", "99");
map_mst.put("confirm_optid", currentUserId + "");
map_mst.put("confirm_optname", nickName);
map_mst.put("confirm_id", currentUserId + "");
map_mst.put("confirm_name", nickName);
map_mst.put("confirm_time", now);
//更新主表状态
wo_mst.update(map_mst, "iostorinv_id = '" + iostorinv_id + "'");
@@ -1107,8 +1107,8 @@ public class ProductOutServiceImpl implements ProductOutService {
HashMap<String, String> map = new HashMap<>();
map.put("task_status", TaskStatusEnum.FINISHED.getCode());
map.put("update_optid", currentUserId + "");
map.put("update_optname", nickName);
map.put("update_id", currentUserId + "");
map.put("update_name", nickName);
map.put("update_time", now);
//更新任务为完成
@@ -1181,8 +1181,8 @@ public class ProductOutServiceImpl implements ProductOutService {
JSONObject mst_row2 = mst_wql.query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "'").uniqueResult(0);
mst_row2.put("bill_status", "99");
mst_row2.put("confirm_optid", currentUserId);
mst_row2.put("confirm_optname", nickName);
mst_row2.put("confirm_id", currentUserId);
mst_row2.put("confirm_name", nickName);
mst_row2.put("confirm_time", now);
//更新主表状态为99
mst_wql.update(mst_row2);
@@ -1444,11 +1444,11 @@ public class ProductOutServiceImpl implements ProductOutService {
String now = DateUtil.now();
//查询主表信息
JSONObject jo_mst = wo_mst.query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
jo_mst.put("update_optid", currentUserId + "");
jo_mst.put("update_optname", nickName);
jo_mst.put("update_id", currentUserId + "");
jo_mst.put("update_name", nickName);
jo_mst.put("update_time", now);
jo_mst.put("dis_optid", currentUserId + "");
jo_mst.put("dis_optname", nickName);
jo_mst.put("dis_id", currentUserId + "");
jo_mst.put("dis_name", nickName);
jo_mst.put("dis_time", now);
//更新主表状态
JSONArray dtls_40 = wo_dtl.query("bill_status='30' and iostorinv_id = '" + iostorinv_id + "'").getResultJSONArray(0);

View File

@@ -282,8 +282,8 @@ public class WorkprocedureiosServiceOutImpl implements WorkprocedureiosOutServic
String task_id = callMaterialTask.createTask(form);
JSONObject json = new JSONObject();
json.put("task_id", task_id);
json.put("update_optid", SecurityUtils.getCurrentUserId());
json.put("update_optname", SecurityUtils.getCurrentNickName());
json.put("update_id", SecurityUtils.getCurrentUserId());
json.put("update_name", SecurityUtils.getCurrentNickName());
json.put("update_time", DateUtil.now());
json.put("bill_status", "20");
wo.update(json, "iostorinv_id = '" + iostorinv_id + "'");

View File

@@ -124,4 +124,81 @@
ENDSELECT
ENDQUERY
ENDIF
ENDIF
IF 输入.flag = "4"
QUERY
SELECT
point.struct_id point_id,
point.struct_code point_code,
point.struct_name point_name,
point.control_point,
region.sect_code region_code,
region.sect_name region_name
FROM
st_ivt_structattr point
LEFT JOIN st_ivt_sectattr region ON point.sect_code = region.sect_code
WHERE
point.lock_type = '0'
AND point.is_delete = '0'
AND point.is_used = '1'
AND IFNULL(point.control_point,'') <> ''
OPTION 输入.region_code <> ""
point.sect_code = 输入.region_code
ENDOPTION
order by point.struct_code ASC
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "5"
QUERY
SELECT
point.struct_id point_id,
point.struct_code point_code,
point.struct_name point_name,
region.sect_code region_code,
region.sect_name region_name
FROM
st_ivt_structattr point
LEFT JOIN st_ivt_sectattr region ON point.sect_code = region.sect_code
WHERE
point.lock_type = '0'
AND point.is_delete = '0'
AND point.is_used = '1'
OPTION 输入.region_code <> ""
point.sect_code = 输入.region_code
ENDOPTION
order by point.struct_code ASC
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "6"
QUERY
SELECT
point.struct_id point_id,
point.struct_code point_code,
point.struct_name point_name,
region.sect_code region_code,
region.sect_name region_name
FROM
st_ivt_structattr point
LEFT JOIN st_ivt_sectattr region ON point.sect_code = region.sect_code
WHERE
point.lock_type = '0'
AND point.is_delete = '0'
AND point.is_used = '1'
OPTION 输入.region_code <> ""
point.sect_code = 输入.region_code
ENDOPTION
order by point.struct_code DESC
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -115,4 +115,23 @@
group by value
ENDSELECT
ENDQUERY
ENDIF
ENDIF
IF 输入.flag = "5"
QUERY
SELECT
struct.struct_code point_code,
struct.struct_name point_name
FROM
st_ivt_structattr struct
WHERE
struct.is_delete = '0'
AND struct.is_used = '1'
OPTION 输入.id <> ""
struct.struct_id = 输入.id
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF