111
This commit is contained in:
		@ -78,7 +78,7 @@ public class BusMaterialsorderController extends BaseController {
 | 
			
		||||
     * @param batchNumber 主键
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("cailiaoshebei:materialsorder:spQuery")
 | 
			
		||||
    @GetMapping("//{batchNumber}")
 | 
			
		||||
    @GetMapping("/spQuery/{batchNumber}")
 | 
			
		||||
    public R<BusCailiaoshebeiPici> spQuery(@NotNull(message = "主键不能为空") @PathVariable String batchNumber) {
 | 
			
		||||
        return R.ok(busCailiaoshebeiPiciService.queryByBatchNumber(batchNumber));
 | 
			
		||||
    }
 | 
			
		||||
@ -117,6 +117,14 @@ public class BusMaterialsorderController extends BaseController {
 | 
			
		||||
        if (upEntity.isEmpty()){
 | 
			
		||||
            throw new ServiceException("请选择要修改的行");
 | 
			
		||||
        }
 | 
			
		||||
        //如果批次号状态不为草稿,那么不允许修改
 | 
			
		||||
        for (BusMaterialsorder busMaterialsorder : upEntity) {
 | 
			
		||||
            busMaterialsorder.setBatchNumber(req.getBatchNumber());
 | 
			
		||||
            BusCailiaoshebeiPici busCailiaoshebeiPici = busCailiaoshebeiPiciService.queryByBatchNumber(busMaterialsorder.getBatchNumber());
 | 
			
		||||
            if (!"draft".equals(busCailiaoshebeiPici.getApprovalOrder())){
 | 
			
		||||
                throw new ServiceException("批次号状态不为草稿,不允许修改");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return toAjax(busMaterialsorderService.updateBatchById(upEntity));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -130,6 +138,16 @@ public class BusMaterialsorderController extends BaseController {
 | 
			
		||||
        return busMaterialsorderService.queryPageList(bo, pageQuery);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 订货-批次号列表(供货商修改版)
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("cailiaoshebei:materialsorder:pcPlanListGHS")
 | 
			
		||||
    @GetMapping("/pcPlanListGHS")
 | 
			
		||||
    public TableDataInfo<BusCailiaoshebeiPiciVo> pcPlanListGHS(BusCailiaoshebeiPiciPcListReq bo, PageQuery pageQuery) {
 | 
			
		||||
        BusCailiaoshebeiPiciBo busCailiaoshebeiPiciBo = BeanUtil.copyProperties(bo, BusCailiaoshebeiPiciBo.class);
 | 
			
		||||
        return busCailiaoshebeiPiciService.queryPageList(busCailiaoshebeiPiciBo, pageQuery);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    //================================物资设备批次需求计划执行跟踪================================
 | 
			
		||||
@ -163,8 +181,8 @@ public class BusMaterialsorderController extends BaseController {
 | 
			
		||||
    @Log(title = "跟踪-变更物资设备执行状态", businessType = BusinessType.UPDATE)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PostMapping("/changeTheStatusOfTheMaterials")
 | 
			
		||||
    public R<Void> changeTheStatusOfTheMaterials(ChangeTheStatusOfTheMaterialsReq bo,@RequestPart("file") MultipartFile file) {
 | 
			
		||||
        System.out.println("------------"+bo.toString());
 | 
			
		||||
    public R<Void> changeTheStatusOfTheMaterials(ChangeTheStatusOfTheMaterialsReq bo,@RequestParam(value = "file", required = false) MultipartFile file) {
 | 
			
		||||
        System.out.println("!!!!!!!!!!!!!!!!!!!!");
 | 
			
		||||
        BusMaterialsorderBo busMaterialsorderBo = BeanUtil.copyProperties(bo, BusMaterialsorderBo.class);
 | 
			
		||||
        return toAjax(busMaterialsorderService.updateByBo(busMaterialsorderBo,file));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -100,7 +100,7 @@ public class BusCailiaoshebeiAddReq extends BaseEntity {
 | 
			
		||||
    /**
 | 
			
		||||
     * 物料编码 (必填)
 | 
			
		||||
     */
 | 
			
		||||
    @NotBlank(message = "物料编码不能为空", groups = { AddGroup.class })
 | 
			
		||||
//    @NotBlank(message = "物料编码不能为空", groups = { AddGroup.class })
 | 
			
		||||
    @Size(max = 128, message = "物料编码长度不能超过255个字符", groups = {AddGroup.class, EditGroup.class})
 | 
			
		||||
    private String materialCode;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -28,6 +28,12 @@ public class BusCailiaoshebeiEditReq extends BaseEntity {
 | 
			
		||||
    @NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 批次号不能为空
 | 
			
		||||
     */
 | 
			
		||||
    @NotNull(message = "批次号不能为空", groups = { EditGroup.class })
 | 
			
		||||
    private String batchNumber;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 供货商ID (必填)
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
@ -27,4 +27,6 @@ public class BusCailiaoshebeiPiciPcListReq implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    @NotBlank(message = "批次号不能为空")
 | 
			
		||||
    private String batchNumber;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,7 @@
 | 
			
		||||
package org.dromara.cailiaoshebei.domain.bo;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.TableName;
 | 
			
		||||
import jakarta.validation.constraints.NotBlank;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.EqualsAndHashCode;
 | 
			
		||||
 | 
			
		||||
@ -19,8 +20,15 @@ public class BusMaterialbatchdemandplanAddReq implements Serializable {
 | 
			
		||||
    /**
 | 
			
		||||
     * 批次号
 | 
			
		||||
     */
 | 
			
		||||
    @NotBlank(message = "批次号不能为空")
 | 
			
		||||
    private String batchNumber;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目ID
 | 
			
		||||
     */
 | 
			
		||||
    @NotBlank(message = "项目ID不能为空")
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增数据信息
 | 
			
		||||
 | 
			
		||||
@ -12,6 +12,7 @@ import jakarta.validation.constraints.*;
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonFormat;
 | 
			
		||||
import org.springframework.web.multipart.MultipartFile;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物资-设备订货业务对象 bus_materialsorder
 | 
			
		||||
@ -166,7 +167,4 @@ public class BusMaterialsorderBo extends BaseEntity {
 | 
			
		||||
     * 单据类型(0:无单据 1:签收单,2:退货单 )
 | 
			
		||||
     */
 | 
			
		||||
    private String billType;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -4,6 +4,7 @@ import jakarta.validation.constraints.NotBlank;
 | 
			
		||||
import jakarta.validation.constraints.NotNull;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.experimental.Accessors;
 | 
			
		||||
import org.springframework.web.multipart.MultipartFile;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
@ -16,9 +17,11 @@ import java.time.LocalDate;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@Accessors(chain = true)
 | 
			
		||||
public class ChangeTheStatusOfTheMaterialsReq implements Serializable {
 | 
			
		||||
public class ChangeTheStatusOfTheMaterialsReq  {
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
@ -26,7 +26,6 @@ public class MasterDataListReq implements Serializable {
 | 
			
		||||
    /**
 | 
			
		||||
     * 批次号
 | 
			
		||||
     */
 | 
			
		||||
    @NotBlank(message = "批次号不能为空")
 | 
			
		||||
    private String batchNumber;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 | 
			
		||||
@ -14,6 +14,11 @@ import java.util.List;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
public class ModifyTheOrderFormGYSReq implements Serializable {
 | 
			
		||||
    /**
 | 
			
		||||
     * 批次号
 | 
			
		||||
     */
 | 
			
		||||
    private String batchNumber;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 订货-主体数据
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
@ -38,6 +38,11 @@ public class BusCailiaoshebeiEditPlanDto implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    private String supplierCompany;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 数量
 | 
			
		||||
     */
 | 
			
		||||
    private int num;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
@ -10,6 +10,7 @@ import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -78,7 +79,7 @@ public class BusCailiaoshebeiPiciVo implements Serializable {
 | 
			
		||||
    /**
 | 
			
		||||
     * 订货-采购时间
 | 
			
		||||
     */
 | 
			
		||||
    private Date purchasingPeriod;
 | 
			
		||||
    private LocalDate purchasingPeriod;
 | 
			
		||||
    /**
 | 
			
		||||
     * 订货-合同号
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
@ -20,9 +20,9 @@ public class MasterDataListRes implements Serializable {
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 批次ID
 | 
			
		||||
     * 批次号
 | 
			
		||||
     */
 | 
			
		||||
    private String batchId;
 | 
			
		||||
    private String batchNumber;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目ID
 | 
			
		||||
 | 
			
		||||
@ -160,17 +160,17 @@ public class BusCailiaoshebeiPiciServiceImpl extends ServiceImpl<BusCailiaoshebe
 | 
			
		||||
                        }
 | 
			
		||||
                        break;
 | 
			
		||||
                    case "2": //计划
 | 
			
		||||
                        if (!"finish".equals(busCailiaoshebeiPici.getApprovalPlan())){
 | 
			
		||||
                        if (!"draft".equals(busCailiaoshebeiPici.getApprovalPlan())){
 | 
			
		||||
                            throw new ServiceException("非草稿状态不允许删除");
 | 
			
		||||
                        }
 | 
			
		||||
                        break;
 | 
			
		||||
                    case "3": //需求
 | 
			
		||||
                        if (!"sc".equals(busCailiaoshebeiPici.getApprovalProject())){
 | 
			
		||||
                        if (!"draft".equals(busCailiaoshebeiPici.getApprovalProject())){
 | 
			
		||||
                            throw new ServiceException("非草稿状态不允许删除");
 | 
			
		||||
                        }
 | 
			
		||||
                        break;
 | 
			
		||||
                    case "4": //订货
 | 
			
		||||
                        if (!"sc".equals(busCailiaoshebeiPici.getApprovalOrder())){
 | 
			
		||||
                        if (!"draft".equals(busCailiaoshebeiPici.getApprovalOrder())){
 | 
			
		||||
                            throw new ServiceException("非草稿状态不允许删除");
 | 
			
		||||
                        }
 | 
			
		||||
                        break;
 | 
			
		||||
 | 
			
		||||
@ -187,6 +187,10 @@ public class BusMaterialbatchdemandplanServiceImpl extends ServiceImpl<BusMateri
 | 
			
		||||
        baseMapper.delete(eq);
 | 
			
		||||
        //2、新增数据
 | 
			
		||||
        List<BusMaterialbatchdemandplan> ts = BeanUtil.copyToList(bo.getAddDataList(), BusMaterialbatchdemandplan.class);
 | 
			
		||||
        for (BusMaterialbatchdemandplan t : ts) {
 | 
			
		||||
            t.setBatchNumber(bo.getBatchNumber());
 | 
			
		||||
            t.setProjectId(bo.getProjectId());
 | 
			
		||||
        }
 | 
			
		||||
        boolean b = baseMapper.insertBatch(ts);
 | 
			
		||||
        if (b) {
 | 
			
		||||
            return true;
 | 
			
		||||
 | 
			
		||||
@ -185,20 +185,20 @@ public class BusMaterialsorderServiceImpl extends ServiceImpl<BusMaterialsorderM
 | 
			
		||||
        rq.setOperationStatus(operationStatus);
 | 
			
		||||
        rq.setOperationName(loginUser.getUsername());
 | 
			
		||||
//            rq.setOperationPhone(loginUser.getNickname());
 | 
			
		||||
        if (bo.getBillType().equals("1")){
 | 
			
		||||
        if ("1".equals(bo.getBillType())){
 | 
			
		||||
            SysOssUploadVo wordEntity = ossService.uploadWithNoSave(file, ossService.minioFileName(ContactNoticeTemplate,file));
 | 
			
		||||
            bo.setSignatureForm(wordEntity.getUrl());
 | 
			
		||||
            update.setSignatureForm(wordEntity.getUrl());
 | 
			
		||||
        }
 | 
			
		||||
        if (bo.getBillType().equals("2")){
 | 
			
		||||
        if ("2".equals(bo.getBillType())){
 | 
			
		||||
            SysOssUploadVo wordEntity = ossService.uploadWithNoSave(file, ossService.minioFileName(ContactNoticeTemplate,file));
 | 
			
		||||
            bo.setReturnedSalesReport(wordEntity.getUrl());
 | 
			
		||||
            update.setReturnedSalesReport(wordEntity.getUrl());
 | 
			
		||||
        }
 | 
			
		||||
        //入库
 | 
			
		||||
        if (operationStatus.equals("1")){ //签收
 | 
			
		||||
        if ("1".equals(operationStatus)){ //签收
 | 
			
		||||
            //增加库存
 | 
			
		||||
            rq.setChangeReasons("系统入库");
 | 
			
		||||
            busRepertoryDetailsService.insertByBo(rq);
 | 
			
		||||
        }else if(operationStatus.equals("2")){//退货
 | 
			
		||||
        }else if("2".equals(operationStatus)){//退货
 | 
			
		||||
            rq.setChangeReasons("系统出库");
 | 
			
		||||
            busRepertoryDetailsService.insertByBo(rq);
 | 
			
		||||
        }
 | 
			
		||||
@ -286,7 +286,7 @@ public class BusMaterialsorderServiceImpl extends ServiceImpl<BusMaterialsorderM
 | 
			
		||||
        if (bi == null){
 | 
			
		||||
            throw new RuntimeException("未获取到订货批次数据");
 | 
			
		||||
        }
 | 
			
		||||
        if (!"0".equals(bi.getApprovalProject())){
 | 
			
		||||
        if (!"draft".equals(bi.getApprovalOrder())){
 | 
			
		||||
            throw new RuntimeException("非草稿状态,不允许修改");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -304,6 +304,9 @@ public class BusMaterialsorderServiceImpl extends ServiceImpl<BusMaterialsorderM
 | 
			
		||||
        //2、删除主体详情数据
 | 
			
		||||
        baseMapper.delete(new LambdaQueryWrapper<BusMaterialsorder>().eq(BusMaterialsorder::getBatchNumber, req.getBatchNumber()));
 | 
			
		||||
        //3、新增主体详情数据
 | 
			
		||||
        for (BusMaterialsorder busMaterialsorder : list) {
 | 
			
		||||
            busMaterialsorder.setBatchNumber(req.getBatchNumber());
 | 
			
		||||
        }
 | 
			
		||||
        return baseMapper.insertBatch(list);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -6,21 +6,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
			
		||||
 | 
			
		||||
    <select id="masterDataList" resultType="org.dromara.cailiaoshebei.domain.vo.MasterDataListRes">
 | 
			
		||||
        select
 | 
			
		||||
            bc.batch_number as batchNumber,
 | 
			
		||||
            bc.project_id as projectId,
 | 
			
		||||
            bc.supplier_id as supplierId,
 | 
			
		||||
            bc.supplier as supplier,
 | 
			
		||||
--             id null,
 | 
			
		||||
--             project_id null,
 | 
			
		||||
            bc.id as cailiaoshebeiId,
 | 
			
		||||
            bsp.id as suppliespriceId,
 | 
			
		||||
--             batch_number null,
 | 
			
		||||
            bc.material_code as materialCode,
 | 
			
		||||
            bc.name as name,
 | 
			
		||||
            bc.specification as specification,
 | 
			
		||||
            bc.signalment as signalment,
 | 
			
		||||
            bc.material_code as materialCode,
 | 
			
		||||
            bsp.id as id,
 | 
			
		||||
            bsp.cailiaoshebei_id as cailiaoshebeiId,
 | 
			
		||||
            bsp.unit_price as unitPrice,
 | 
			
		||||
            bsp.num as num,
 | 
			
		||||
            bsp.contract_num as contractNum,
 | 
			
		||||
            bsp.estimated_cycle as estimatedCycle,
 | 
			
		||||
            bsp.supplier_company as supplierCompany
 | 
			
		||||
            bc.unit as unit,
 | 
			
		||||
            bsp.supplier_company as supplierCompany,
 | 
			
		||||
            bsp.estimated_cycle as estimatedCycle
 | 
			
		||||
--             demand_quantity null,
 | 
			
		||||
--             arrival_time null
 | 
			
		||||
        from
 | 
			
		||||
            bus_suppliesprice as bsp
 | 
			
		||||
            left join bus_cailiaoshebei as bc on bc.id = bsp.cailiaoshebei_id
 | 
			
		||||
 | 
			
		||||
@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
			
		||||
                and bsp.name like concat('%', #{bo.name}, '%')
 | 
			
		||||
            </if>
 | 
			
		||||
        </where>
 | 
			
		||||
        order by bc.create_time desc
 | 
			
		||||
    </select>
 | 
			
		||||
 | 
			
		||||
</mapper>
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user