Compare commits
No commits in common. "3167ad09c4162ad80503b55d92ffb77eb0fdd49f" and "a8d3147ac92d93015f503f9eacdecc34d7cd0ba1" have entirely different histories.
3167ad09c4
...
a8d3147ac9
@ -1,155 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2018.
|
|
||||||
* http://www.ulabcare.com
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.cnbm.admin.base;
|
|
||||||
|
|
||||||
import com.cnbm.admin.entity.LoginUser;
|
|
||||||
import com.cnbm.admin.enums.WhetherEnum;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.core.NamedThreadLocal;
|
|
||||||
import org.springframework.security.authentication.AuthenticationManager;
|
|
||||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
|
||||||
import org.springframework.security.core.Authentication;
|
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.web.context.request.RequestContextHolder;
|
|
||||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import javax.servlet.http.HttpSession;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 接口支持基类
|
|
||||||
*
|
|
||||||
* @author jiff
|
|
||||||
* @date 2018/11/1
|
|
||||||
* @since 1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class BaseSupport {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取当前登录用户信息
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
protected LoginUser getLoginUser() {
|
|
||||||
UsernamePasswordAuthenticationToken authentication = (UsernamePasswordAuthenticationToken) SecurityContextHolder.getContext().getAuthentication();
|
|
||||||
|
|
||||||
if (Objects.isNull(authentication)) {
|
|
||||||
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
|
|
||||||
return loginUser;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置公共字段值,一般用于创建新记录,包含以下字段:
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* {@link CommonField#enabled}<br>
|
|
||||||
* {@link CommonField#valid}<br>
|
|
||||||
* {@link CommonField#creatorId}<br>
|
|
||||||
* {@link CommonField#creatorName}<br>
|
|
||||||
* {@link CommonField#createTime}<br>
|
|
||||||
* {@link CommonField#updaterId}<br>
|
|
||||||
* {@link CommonField#updaterName}<br>
|
|
||||||
* {@link CommonField#updateTime}<br>
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param t 需要设置的对象
|
|
||||||
* @param ignoreProperties 忽略的字段
|
|
||||||
* @param <T>
|
|
||||||
*/
|
|
||||||
public <T extends Serializable> T setCommonField(T t, String... ignoreProperties) {
|
|
||||||
|
|
||||||
CommonField commonField = CommonField.builder()
|
|
||||||
.enabled(WhetherEnum.YES.getValue())
|
|
||||||
.valid(WhetherEnum.YES.getValue())
|
|
||||||
.createTime(LocalDateTime.now())
|
|
||||||
.creatorId(getLoginUser().getSysUserEntity().getId())
|
|
||||||
.creatorName(getLoginUser().getUsername())
|
|
||||||
.updateTime(LocalDateTime.now())
|
|
||||||
.updaterId(getLoginUser().getSysUserEntity().getId())
|
|
||||||
.updaterName(getLoginUser().getUsername())
|
|
||||||
.build();
|
|
||||||
BeanUtils.copyProperties(commonField, t, ignoreProperties);
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置更新的公共字段值,一般用于更新记录,包含以下字段:
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* {@link CommonField#updaterId}<br>
|
|
||||||
* {@link CommonField#updaterName}<br>
|
|
||||||
* {@link CommonField#updateTime}<br>
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param t 需要设置的对象
|
|
||||||
* @param <T>
|
|
||||||
*/
|
|
||||||
public <T extends Serializable> T setUpdateCommonField(T t) {
|
|
||||||
CommonField commonField = CommonField.builder()
|
|
||||||
.updaterId(getLoginUser().getSysUserEntity().getId())
|
|
||||||
.updaterName(getLoginUser().getUsername())
|
|
||||||
.updateTime(LocalDateTime.now())
|
|
||||||
.build();
|
|
||||||
BeanUtils.copyProperties(commonField, t, "enabled", "valid");
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
private static class CommonField implements Serializable {
|
|
||||||
/**
|
|
||||||
* 启用状态:0 、停用,1、启用
|
|
||||||
*/
|
|
||||||
private Integer enabled;
|
|
||||||
/**
|
|
||||||
* 删除标志,是否有效:1 可用 0不可用
|
|
||||||
*/
|
|
||||||
private Integer valid;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建人
|
|
||||||
*/
|
|
||||||
private Long creatorId;
|
|
||||||
/**
|
|
||||||
* 创建人
|
|
||||||
*/
|
|
||||||
private String creatorName;
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新人
|
|
||||||
*/
|
|
||||||
private Long updaterId;
|
|
||||||
/**
|
|
||||||
* 更新人
|
|
||||||
*/
|
|
||||||
private String updaterName;
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime updateTime;
|
|
||||||
}
|
|
||||||
}
|
|
@ -210,9 +210,9 @@ public class WoPackagingBoxSubstrateController {
|
|||||||
@PostMapping("insertSubstrateManual")
|
@PostMapping("insertSubstrateManual")
|
||||||
@ApiOperation("手动装箱")
|
@ApiOperation("手动装箱")
|
||||||
@LogOperation("手动装箱")
|
@LogOperation("手动装箱")
|
||||||
public Result insertSubstrateManual(@RequestBody ChangePackingBoxDTO[] dtos){
|
public Result insertSubstrateManual(@RequestBody ChangePackingBoxDTO dto){
|
||||||
|
|
||||||
woPackagingBoxSubstrateService.insertSubstrateManual(dtos);
|
woPackagingBoxSubstrateService.insertSubstrateManual(dto);
|
||||||
|
|
||||||
return new Result();
|
return new Result();
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ public interface WoPackagingBoxSubstrateServiceBiz extends CrudService<WoPackagi
|
|||||||
|
|
||||||
void replaceSubstrate(ChangePackingBoxDTO[] dtos);
|
void replaceSubstrate(ChangePackingBoxDTO[] dtos);
|
||||||
|
|
||||||
void insertSubstrateManual(ChangePackingBoxDTO[] dtos);
|
void insertSubstrateManual(ChangePackingBoxDTO dto);
|
||||||
|
|
||||||
WoPackagingBoxSubstrate getBySubId(String subId);
|
WoPackagingBoxSubstrate getBySubId(String subId);
|
||||||
int updatePackagingBoxIdByWoSubstrateId(String packagingBoxId,String woSubstrateId);
|
int updatePackagingBoxIdByWoSubstrateId(String packagingBoxId,String woSubstrateId);
|
||||||
|
@ -3,8 +3,6 @@ package com.cnbm.packing.service.impl;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||||
import com.cnbm.admin.base.BaseSupport;
|
|
||||||
import com.cnbm.admin.base.BaseSupport;
|
|
||||||
import com.cnbm.common.page.PageData;
|
import com.cnbm.common.page.PageData;
|
||||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||||
import com.cnbm.common.utils.ConvertUtils;
|
import com.cnbm.common.utils.ConvertUtils;
|
||||||
@ -16,7 +14,6 @@ import com.cnbm.packing.entity.WoPowerLevel;
|
|||||||
import com.cnbm.packing.mapper.ChangePackagingBoxHistoryMapper;
|
import com.cnbm.packing.mapper.ChangePackagingBoxHistoryMapper;
|
||||||
import com.cnbm.packing.service.ChangePackagingBoxHistoryServiceBiz;
|
import com.cnbm.packing.service.ChangePackagingBoxHistoryServiceBiz;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@ -33,9 +30,6 @@ import java.util.Map;
|
|||||||
@Service
|
@Service
|
||||||
public class ChangePackagingBoxHistoryServiceBizImpl extends CrudServiceImpl<ChangePackagingBoxHistoryMapper, ChangePackagingBoxHistory, ChangePackagingBoxHistoryDTO> implements ChangePackagingBoxHistoryServiceBiz {
|
public class ChangePackagingBoxHistoryServiceBizImpl extends CrudServiceImpl<ChangePackagingBoxHistoryMapper, ChangePackagingBoxHistory, ChangePackagingBoxHistoryDTO> implements ChangePackagingBoxHistoryServiceBiz {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private BaseSupport baseSupport;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryWrapper<ChangePackagingBoxHistory> getWrapper(Map<String, Object> params){
|
public QueryWrapper<ChangePackagingBoxHistory> getWrapper(Map<String, Object> params){
|
||||||
LocalDateTime startTime = (LocalDateTime) params.get("startTime");
|
LocalDateTime startTime = (LocalDateTime) params.get("startTime");
|
||||||
@ -71,7 +65,6 @@ public class ChangePackagingBoxHistoryServiceBizImpl extends CrudServiceImpl<Cha
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void save(ChangePackagingBoxHistoryDTO dto) {
|
public void save(ChangePackagingBoxHistoryDTO dto) {
|
||||||
ChangePackagingBoxHistory entity = ConvertUtils.sourceToTarget(dto, ChangePackagingBoxHistory.class);
|
ChangePackagingBoxHistory entity = ConvertUtils.sourceToTarget(dto, ChangePackagingBoxHistory.class);
|
||||||
baseSupport.setCommonField(entity);
|
|
||||||
insert(entity);
|
insert(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +72,6 @@ public class ChangePackagingBoxHistoryServiceBizImpl extends CrudServiceImpl<Cha
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void update(ChangePackagingBoxHistoryDTO dto) {
|
public void update(ChangePackagingBoxHistoryDTO dto) {
|
||||||
ChangePackagingBoxHistory entity = ConvertUtils.sourceToTarget(dto, ChangePackagingBoxHistory.class);
|
ChangePackagingBoxHistory entity = ConvertUtils.sourceToTarget(dto, ChangePackagingBoxHistory.class);
|
||||||
baseSupport.setUpdateCommonField(entity);
|
|
||||||
updateById(entity);
|
updateById(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ package com.cnbm.packing.service.impl;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||||
import com.cnbm.admin.base.BaseSupport;
|
|
||||||
import com.cnbm.admin.utils.CodeGeneratorHelper;
|
import com.cnbm.admin.utils.CodeGeneratorHelper;
|
||||||
import com.cnbm.common.page.PageData;
|
import com.cnbm.common.page.PageData;
|
||||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||||
@ -32,8 +31,6 @@ public class PrintModelServiceBizImpl extends CrudServiceImpl<PrintModelMapper,
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PrintModelMapper mapper;
|
private PrintModelMapper mapper;
|
||||||
@Autowired
|
|
||||||
private BaseSupport baseSupport;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryWrapper<PrintModel> getWrapper(Map<String, Object> params){
|
public QueryWrapper<PrintModel> getWrapper(Map<String, Object> params){
|
||||||
@ -72,7 +69,6 @@ public class PrintModelServiceBizImpl extends CrudServiceImpl<PrintModelMapper,
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void save(PrintModelDTO dto) {
|
public void save(PrintModelDTO dto) {
|
||||||
PrintModel entity = ConvertUtils.sourceToTarget(dto, PrintModel.class);
|
PrintModel entity = ConvertUtils.sourceToTarget(dto, PrintModel.class);
|
||||||
baseSupport.setCommonField(entity);
|
|
||||||
insert(entity);
|
insert(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +76,6 @@ public class PrintModelServiceBizImpl extends CrudServiceImpl<PrintModelMapper,
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void update(PrintModelDTO dto) {
|
public void update(PrintModelDTO dto) {
|
||||||
PrintModel entity = ConvertUtils.sourceToTarget(dto, PrintModel.class);
|
PrintModel entity = ConvertUtils.sourceToTarget(dto, PrintModel.class);
|
||||||
baseSupport.setUpdateCommonField(entity);
|
|
||||||
updateById(entity);
|
updateById(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ package com.cnbm.packing.service.impl;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||||
import com.cnbm.admin.base.BaseSupport;
|
|
||||||
import com.cnbm.common.page.PageData;
|
import com.cnbm.common.page.PageData;
|
||||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||||
import com.cnbm.common.utils.ConvertUtils;
|
import com.cnbm.common.utils.ConvertUtils;
|
||||||
@ -35,8 +34,6 @@ public class WoCompensationPowerServiceBizImpl extends CrudServiceImpl<WoCompens
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private WoCompensationPowerMapper mapper;
|
private WoCompensationPowerMapper mapper;
|
||||||
@Autowired
|
|
||||||
private BaseSupport baseSupport;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryWrapper<WoCompensationPower> getWrapper(Map<String, Object> params){
|
public QueryWrapper<WoCompensationPower> getWrapper(Map<String, Object> params){
|
||||||
@ -69,7 +66,6 @@ public class WoCompensationPowerServiceBizImpl extends CrudServiceImpl<WoCompens
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void save(WoCompensationPowerDTO dto) {
|
public void save(WoCompensationPowerDTO dto) {
|
||||||
WoCompensationPower entity = ConvertUtils.sourceToTarget(dto, WoCompensationPower.class);
|
WoCompensationPower entity = ConvertUtils.sourceToTarget(dto, WoCompensationPower.class);
|
||||||
baseSupport.setCommonField(entity);
|
|
||||||
insert(entity);
|
insert(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +73,6 @@ public class WoCompensationPowerServiceBizImpl extends CrudServiceImpl<WoCompens
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void update(WoCompensationPowerDTO dto) {
|
public void update(WoCompensationPowerDTO dto) {
|
||||||
WoCompensationPower entity = ConvertUtils.sourceToTarget(dto, WoCompensationPower.class);
|
WoCompensationPower entity = ConvertUtils.sourceToTarget(dto, WoCompensationPower.class);
|
||||||
baseSupport.setUpdateCommonField(entity);
|
|
||||||
updateById(entity);
|
updateById(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ package com.cnbm.packing.service.impl;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||||
import com.cnbm.admin.base.BaseSupport;
|
|
||||||
import com.cnbm.common.page.PageData;
|
import com.cnbm.common.page.PageData;
|
||||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||||
import com.cnbm.common.utils.ConvertUtils;
|
import com.cnbm.common.utils.ConvertUtils;
|
||||||
@ -37,9 +36,6 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox
|
|||||||
private WoPackagingBoxMapper mapper;
|
private WoPackagingBoxMapper mapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private WoPackagingBoxSubstrateMapper substrateMapper;
|
private WoPackagingBoxSubstrateMapper substrateMapper;
|
||||||
@Autowired
|
|
||||||
private BaseSupport baseSupport;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryWrapper<WoPackagingBox> getWrapper(Map<String, Object> params){
|
public QueryWrapper<WoPackagingBox> getWrapper(Map<String, Object> params){
|
||||||
|
|
||||||
@ -87,7 +83,6 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox
|
|||||||
public IdVo add(WoPackagingBoxDTO dto) {
|
public IdVo add(WoPackagingBoxDTO dto) {
|
||||||
WoPackagingBox entity = ConvertUtils.sourceToTarget(dto, WoPackagingBox.class);
|
WoPackagingBox entity = ConvertUtils.sourceToTarget(dto, WoPackagingBox.class);
|
||||||
insert(entity);
|
insert(entity);
|
||||||
baseSupport.setCommonField(entity);
|
|
||||||
return IdVo.builder().id(entity.getId()).build();
|
return IdVo.builder().id(entity.getId()).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,7 +90,6 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void update(WoPackagingBoxDTO dto) {
|
public void update(WoPackagingBoxDTO dto) {
|
||||||
WoPackagingBox entity = ConvertUtils.sourceToTarget(dto, WoPackagingBox.class);
|
WoPackagingBox entity = ConvertUtils.sourceToTarget(dto, WoPackagingBox.class);
|
||||||
baseSupport.setUpdateCommonField(entity);
|
|
||||||
updateById(entity);
|
updateById(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ package com.cnbm.packing.service.impl;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.cnbm.admin.base.BaseSupport;
|
|
||||||
import com.cnbm.common.page.PageData;
|
import com.cnbm.common.page.PageData;
|
||||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||||
import com.cnbm.common.utils.ConvertUtils;
|
import com.cnbm.common.utils.ConvertUtils;
|
||||||
@ -42,8 +41,6 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac
|
|||||||
private ChangePackagingBoxHistoryServiceBiz changePackagingBoxHistoryService;
|
private ChangePackagingBoxHistoryServiceBiz changePackagingBoxHistoryService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private WoPackagingBoxSubstrateMapper mapper;
|
private WoPackagingBoxSubstrateMapper mapper;
|
||||||
@Autowired
|
|
||||||
private BaseSupport baseSupport;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryWrapper<WoPackagingBoxSubstrate> getWrapper(Map<String, Object> params){
|
public QueryWrapper<WoPackagingBoxSubstrate> getWrapper(Map<String, Object> params){
|
||||||
@ -78,7 +75,6 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void save(WoPackagingBoxSubstrateDTO dto) {
|
public void save(WoPackagingBoxSubstrateDTO dto) {
|
||||||
WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class);
|
WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class);
|
||||||
baseSupport.setCommonField(entity);
|
|
||||||
insert(entity);
|
insert(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +82,6 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void update(WoPackagingBoxSubstrateDTO dto) {
|
public void update(WoPackagingBoxSubstrateDTO dto) {
|
||||||
WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class);
|
WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class);
|
||||||
baseSupport.setUpdateCommonField(entity);
|
|
||||||
updateById(entity);
|
updateById(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,7 +103,6 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac
|
|||||||
changePackagingBoxHistory.setSourceSlot(entity.getSlot());
|
changePackagingBoxHistory.setSourceSlot(entity.getSlot());
|
||||||
changePackagingBoxHistory.setLeaveTime(LocalDateTime.now());
|
changePackagingBoxHistory.setLeaveTime(LocalDateTime.now());
|
||||||
changePackagingBoxHistory.setType(2);
|
changePackagingBoxHistory.setType(2);
|
||||||
baseSupport.setCommonField(changePackagingBoxHistory);
|
|
||||||
changePackagingBoxHistoryService.insert(changePackagingBoxHistory);
|
changePackagingBoxHistoryService.insert(changePackagingBoxHistory);
|
||||||
//模组从该包装箱中移出,该模组变为未绑定BoxID的模组
|
//模组从该包装箱中移出,该模组变为未绑定BoxID的模组
|
||||||
UpdateWrapper<WoPackagingBoxSubstrate> wrapper = new UpdateWrapper<>();
|
UpdateWrapper<WoPackagingBoxSubstrate> wrapper = new UpdateWrapper<>();
|
||||||
@ -132,12 +126,10 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac
|
|||||||
changePackagingBoxHistory.setTargetSlot(dto.getSlot());
|
changePackagingBoxHistory.setTargetSlot(dto.getSlot());
|
||||||
changePackagingBoxHistory.setInputTime(LocalDateTime.now());
|
changePackagingBoxHistory.setInputTime(LocalDateTime.now());
|
||||||
changePackagingBoxHistory.setType(1);
|
changePackagingBoxHistory.setType(1);
|
||||||
baseSupport.setCommonField(changePackagingBoxHistory);
|
|
||||||
changePackagingBoxHistoryService.insert(changePackagingBoxHistory);
|
changePackagingBoxHistoryService.insert(changePackagingBoxHistory);
|
||||||
//更新
|
//更新
|
||||||
entity.setPackagingBoxId(dto.getPackagingBoxId());
|
entity.setPackagingBoxId(dto.getPackagingBoxId());
|
||||||
entity.setSlot(dto.getSlot());
|
entity.setSlot(dto.getSlot());
|
||||||
baseSupport.setUpdateCommonField(entity);
|
|
||||||
updateById(entity);
|
updateById(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,28 +146,26 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac
|
|||||||
changePackagingBoxHistory.setTargetBoxNo(dto.getPackagingBoxId());
|
changePackagingBoxHistory.setTargetBoxNo(dto.getPackagingBoxId());
|
||||||
changePackagingBoxHistory.setTargetSlot(dto.getSlot());
|
changePackagingBoxHistory.setTargetSlot(dto.getSlot());
|
||||||
changePackagingBoxHistory.setType(3);
|
changePackagingBoxHistory.setType(3);
|
||||||
baseSupport.setCommonField(changePackagingBoxHistory);
|
|
||||||
changePackagingBoxHistoryService.insert(changePackagingBoxHistory);
|
changePackagingBoxHistoryService.insert(changePackagingBoxHistory);
|
||||||
//更新
|
//更新
|
||||||
entity.setPackagingBoxId(dto.getPackagingBoxId());
|
entity.setPackagingBoxId(dto.getPackagingBoxId());
|
||||||
entity.setSlot(dto.getSlot());
|
entity.setSlot(dto.getSlot());
|
||||||
baseSupport.setUpdateCommonField(entity);
|
|
||||||
updateById(entity);
|
updateById(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void insertSubstrateManual(ChangePackingBoxDTO[] dtos) {
|
public void insertSubstrateManual(ChangePackingBoxDTO dto) {
|
||||||
for(ChangePackingBoxDTO dto : dtos) {
|
|
||||||
QueryWrapper<WoPackagingBoxSubstrate> wrapper = new QueryWrapper<>();
|
QueryWrapper<WoPackagingBoxSubstrate> wrapper = new QueryWrapper<>();
|
||||||
wrapper.eq(StringUtils.isNotBlank(dto.getWoSubstrateId()),WoPackagingBoxSubstrate.WO_SUBSTRATE_ID,dto.getWoSubstrateId());
|
wrapper.eq(StringUtils.isNotBlank(dto.getWoSubstrateId()),WoPackagingBoxSubstrate.WO_SUBSTRATE_ID,dto.getWoSubstrateId());
|
||||||
if(mapper.selectCount(wrapper)>0 && StringUtils.isNotBlank(dto.getWoSubstrateId())) {
|
if(mapper.selectCount(wrapper)>0 && StringUtils.isNotBlank(dto.getWoSubstrateId())) {
|
||||||
WoPackagingBoxSubstrate substrate = mapper.selectList(wrapper).get(0);
|
WoPackagingBoxSubstrate substrate = mapper.selectList(wrapper).get(0);
|
||||||
substrate.setPackagingBoxId(dto.getPackagingBoxId());
|
substrate.setPackagingBoxId(dto.getPackagingBoxId());
|
||||||
baseSupport.setUpdateCommonField(substrate);
|
|
||||||
updateById(substrate);
|
updateById(substrate);
|
||||||
} else {
|
}
|
||||||
|
else{
|
||||||
//模组ID有时为空,用户会输入”无码“
|
//模组ID有时为空,用户会输入”无码“
|
||||||
if(dto.getWoSubstrateId()==null) {
|
if(dto.getWoSubstrateId()==null) {
|
||||||
dto.setWoSubstrateId("无码");
|
dto.setWoSubstrateId("无码");
|
||||||
@ -183,11 +173,9 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac
|
|||||||
//效验数据
|
//效验数据
|
||||||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||||
WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class);
|
WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class);
|
||||||
baseSupport.setCommonField(entity);
|
|
||||||
insert(entity);
|
insert(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WoPackagingBoxSubstrate getBySubId(String subId) {
|
public WoPackagingBoxSubstrate getBySubId(String subId) {
|
||||||
|
@ -3,7 +3,6 @@ package com.cnbm.packing.service.impl;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||||
import com.cnbm.admin.base.BaseSupport;
|
|
||||||
import com.cnbm.admin.enums.WhetherEnum;
|
import com.cnbm.admin.enums.WhetherEnum;
|
||||||
import com.cnbm.common.page.PageData;
|
import com.cnbm.common.page.PageData;
|
||||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||||
@ -43,8 +42,6 @@ public class WoPackagingPrintHistoryServiceBizImpl extends CrudServiceImpl<WoPac
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private WoPackagingPrintHistoryMapper mapper;
|
private WoPackagingPrintHistoryMapper mapper;
|
||||||
@Autowired
|
|
||||||
private BaseSupport baseSupport;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private WoPackagingBoxServiceBiz woPackagingBoxServiceBiz;
|
private WoPackagingBoxServiceBiz woPackagingBoxServiceBiz;
|
||||||
@ -81,7 +78,6 @@ public class WoPackagingPrintHistoryServiceBizImpl extends CrudServiceImpl<WoPac
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void save(WoPackagingPrintHistoryDTO dto) {
|
public void save(WoPackagingPrintHistoryDTO dto) {
|
||||||
WoPackagingPrintHistory entity = ConvertUtils.sourceToTarget(dto, WoPackagingPrintHistory.class);
|
WoPackagingPrintHistory entity = ConvertUtils.sourceToTarget(dto, WoPackagingPrintHistory.class);
|
||||||
baseSupport.setCommonField(entity);
|
|
||||||
insert(entity);
|
insert(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,7 +85,6 @@ public class WoPackagingPrintHistoryServiceBizImpl extends CrudServiceImpl<WoPac
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void update(WoPackagingPrintHistoryDTO dto) {
|
public void update(WoPackagingPrintHistoryDTO dto) {
|
||||||
WoPackagingPrintHistory entity = ConvertUtils.sourceToTarget(dto, WoPackagingPrintHistory.class);
|
WoPackagingPrintHistory entity = ConvertUtils.sourceToTarget(dto, WoPackagingPrintHistory.class);
|
||||||
baseSupport.setUpdateCommonField(entity);
|
|
||||||
updateById(entity);
|
updateById(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,7 +112,6 @@ public class WoPackagingPrintHistoryServiceBizImpl extends CrudServiceImpl<WoPac
|
|||||||
BeanUtils.copyProperties(woPackagingBox, woPackagingPrintHistory);
|
BeanUtils.copyProperties(woPackagingBox, woPackagingPrintHistory);
|
||||||
woPackagingPrintHistory.setId(null);
|
woPackagingPrintHistory.setId(null);
|
||||||
woPackagingPrintHistory.setPrintTime(LocalDateTime.now());
|
woPackagingPrintHistory.setPrintTime(LocalDateTime.now());
|
||||||
baseSupport.setCommonField(woPackagingPrintHistory);
|
|
||||||
insert(woPackagingPrintHistory);
|
insert(woPackagingPrintHistory);
|
||||||
//更新包装箱表中打印状态和时间
|
//更新包装箱表中打印状态和时间
|
||||||
woPackagingBox.setPrintTime(woPackagingPrintHistory.getPrintTime());
|
woPackagingBox.setPrintTime(woPackagingPrintHistory.getPrintTime());
|
||||||
@ -128,7 +122,6 @@ public class WoPackagingPrintHistoryServiceBizImpl extends CrudServiceImpl<WoPac
|
|||||||
else{
|
else{
|
||||||
woPackagingBox.setPrintCount(woPackagingBox.getPrintCount()+1);
|
woPackagingBox.setPrintCount(woPackagingBox.getPrintCount()+1);
|
||||||
}
|
}
|
||||||
baseSupport.setUpdateCommonField(woPackagingBox);
|
|
||||||
woPackagingBoxServiceBiz.update(woPackagingBox);
|
woPackagingBoxServiceBiz.update(woPackagingBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ package com.cnbm.packing.service.impl;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||||
import com.cnbm.admin.base.BaseSupport;
|
|
||||||
import com.cnbm.common.page.PageData;
|
import com.cnbm.common.page.PageData;
|
||||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||||
import com.cnbm.common.utils.ConvertUtils;
|
import com.cnbm.common.utils.ConvertUtils;
|
||||||
@ -32,8 +31,6 @@ public class WoPowerLevelServiceBizImpl extends CrudServiceImpl<WoPowerLevelMapp
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private WoPowerLevelMapper mapper;
|
private WoPowerLevelMapper mapper;
|
||||||
@Autowired
|
|
||||||
private BaseSupport baseSupport;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryWrapper<WoPowerLevel> getWrapper(Map<String, Object> params){
|
public QueryWrapper<WoPowerLevel> getWrapper(Map<String, Object> params){
|
||||||
@ -67,7 +64,6 @@ public class WoPowerLevelServiceBizImpl extends CrudServiceImpl<WoPowerLevelMapp
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void save(WoPowerLevelDTO dto) {
|
public void save(WoPowerLevelDTO dto) {
|
||||||
WoPowerLevel entity = ConvertUtils.sourceToTarget(dto, WoPowerLevel.class);
|
WoPowerLevel entity = ConvertUtils.sourceToTarget(dto, WoPowerLevel.class);
|
||||||
baseSupport.setCommonField(entity);
|
|
||||||
insert(entity);
|
insert(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,7 +71,6 @@ public class WoPowerLevelServiceBizImpl extends CrudServiceImpl<WoPowerLevelMapp
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void update(WoPowerLevelDTO dto) {
|
public void update(WoPowerLevelDTO dto) {
|
||||||
WoPowerLevel entity = ConvertUtils.sourceToTarget(dto, WoPowerLevel.class);
|
WoPowerLevel entity = ConvertUtils.sourceToTarget(dto, WoPowerLevel.class);
|
||||||
baseSupport.setUpdateCommonField(entity);
|
|
||||||
updateById(entity);
|
updateById(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user