无关风月
2024-08-01 8876b1b9cd27fad076ea9e5f3e04197b84ba02bd
ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlVolumeProductionRkglServiceImpl.java
@@ -18,6 +18,7 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.domain.getVolumeProductionRkQuery;
import com.ruoyi.system.api.feignClient.LogClient;
import com.ruoyi.system.api.feignClient.SysUserClient;
import org.springframework.stereotype.Service;
@@ -57,6 +58,9 @@
    @Resource
    private  ManagementGoodsMaterialsMapper managementGoodsMaterialsMapper;
    @Resource
    private LogClient logClient;
    @Override
    public PageDTO<SupplierVolumeProductionRkglVO> getSupplierVolumeProductionRkglList(SupplierVolumeProductionRkglQuery supplierVolumeProductionRkglQuery) {
        Page<SlVolumeProductionRkgl> page = new Page<>(supplierVolumeProductionRkglQuery.getPageCurr(), supplierVolumeProductionRkglQuery.getPageSize());
@@ -85,11 +89,13 @@
        SlStoreManagement slStoreManagement = slStoreManagementMapper.selectById(byId.getManagementId());
        v.setStoreManagementName(slStoreManagement.getStoreManagementName());
        SysUser data = sysUserClient.getSysUser(Long.valueOf(byId.getSupplierId())).getData();
        v.setSupplierId(byId.getSupplierId());
        v.setSupplierName(data.getNickName());
        v.setSupplierPhone(data.getPhonenumber());
        SysUser data1 = sysUserClient.getSysUser(Long.valueOf(byId.getSysId())).getData();
        v.setSysName(data1.getNickName());
        v.setSysPhone(data1.getPhonenumber());
        v.setAuthorization(byId.getAuthorizationUrl());
        return v;
    }
@@ -103,10 +109,10 @@
                .collect(Collectors.toSet());
        LambdaQueryWrapper< SlVolumeProductionRkgl> wrapper1= Wrappers.lambdaQuery();
        if (getVolumeProductionRkQuery.getPresentState()!=0&&getVolumeProductionRkQuery.getPresentState()!=null){
        if (getVolumeProductionRkQuery.getPresentState()!=null && getVolumeProductionRkQuery.getPresentState()!=0){
            wrapper1.eq(SlVolumeProductionRkgl::getPresentState,getVolumeProductionRkQuery.getPresentState());
        }
        if (getVolumeProductionRkQuery.getAuditStatus()!=0&&getVolumeProductionRkQuery.getAuditStatus()!=null) {
        if (getVolumeProductionRkQuery.getAuditStatus()!=null && getVolumeProductionRkQuery.getAuditStatus()!=0) {
            wrapper1.eq(SlVolumeProductionRkgl::getAuditStatus, getVolumeProductionRkQuery.getAuditStatus());
        }
        if (goodsSkuIdList.size()>0){
@@ -127,16 +133,19 @@
            list.setNickName(data.getNickName());
            list.setPhonenumber(data.getPhonenumber());
            SlStoreManagement slStoreManagement = slStoreManagementMapper.selectById(list.getManagementId());
            list.setStoreManagementName(slStoreManagement.getStoreManagementName());
            if (slStoreManagement!=null){
                list.setStoreManagementName(slStoreManagement.getStoreManagementName());
            }
        }
        return SlGoodsShelfDTO;
    }
    @Override
    public void addVolumeProductionRkgl(VolumeProductionRkglDTO volumeProductionRkglDTO) {
    public Long addVolumeProductionRkgl(VolumeProductionRkglDTO volumeProductionRkglDTO) {
        Long userid = SecurityUtils.getUserId();
        SlVolumeProductionRkgl slVolumeProductionRkgl=null;
        if (volumeProductionRkglDTO.getId()==null){
            SlVolumeProductionRkgl slVolumeProductionRkgl=new  SlVolumeProductionRkgl();
            new  SlVolumeProductionRkgl();
            slVolumeProductionRkgl.setAttachmentUrl(volumeProductionRkglDTO.getAttachmentUrl());
            slVolumeProductionRkgl.setAuthorizationUrl(volumeProductionRkglDTO.getAuthorization());
            slVolumeProductionRkgl.setAuditStatus(1);
@@ -149,24 +158,28 @@
            slVolumeProductionRkgl.setRemark(volumeProductionRkglDTO.getRemark());
            this.save(slVolumeProductionRkgl);
        }else{
            SlVolumeProductionRkgl byId = this.getById(volumeProductionRkglDTO.getId());
            slVolumeProductionRkgl = this.getById(volumeProductionRkglDTO.getId());
            slVolumeProductionRkgl.setPresentState(1);
            slVolumeProductionRkgl.setAuditStatus(1);
            if (volumeProductionRkglDTO.getSource()!=null){
                byId.setSource(volumeProductionRkglDTO.getSource());
                slVolumeProductionRkgl.setSource(volumeProductionRkglDTO.getSource());
            }
            if (volumeProductionRkglDTO.getRemark()!=null){
                byId.setRemark(volumeProductionRkglDTO.getRemark());
                slVolumeProductionRkgl.setRemark(volumeProductionRkglDTO.getRemark());
            }
            if (volumeProductionRkglDTO.getSupplierId()!=null){
                byId.setSupplierId(volumeProductionRkglDTO.getSupplierId());
                slVolumeProductionRkgl.setSupplierId(volumeProductionRkglDTO.getSupplierId());
            }
            if (volumeProductionRkglDTO.getAttachmentUrl()!=null){
                byId.setAttachmentUrl(volumeProductionRkglDTO.getAttachmentUrl());
                slVolumeProductionRkgl.setAttachmentUrl(volumeProductionRkglDTO.getAttachmentUrl());
            }
            if (volumeProductionRkglDTO.getAuthorization()!=null){
                byId.setAuthorizationUrl(volumeProductionRkglDTO.getAuthorization());
                slVolumeProductionRkgl.setAuthorizationUrl(volumeProductionRkglDTO.getAuthorization());
            }
            this.updateById(byId);
            this.updateById(slVolumeProductionRkgl);
        }
        return slVolumeProductionRkgl.getId();
    }
    @Override
@@ -270,7 +283,8 @@
                managementGoodsMaterials1.setGoodsMaterialsId(list.getMaterialsId());
                managementGoodsMaterials1.setRepertoryZhai(list.getRkNum());
                managementGoodsMaterials1.setRepertorySum(list.getRkNum());
                managementGoodsMaterials.setRepertory(slGoodsMaterials.getRepertory());
                managementGoodsMaterials1.setCreateTime(new Date());
                managementGoodsMaterials1.setRepertory(slGoodsMaterials.getRepertory());
                managementGoodsMaterialsMapper.insert(managementGoodsMaterials1);
            }
        }
@@ -279,6 +293,8 @@
        byId.setAuditStatus(6);
        byId.setEndTime(new Date());
        this.updateById(byId);
        logClient.savelong();
    }
}