Merge remote-tracking branch 'origin/dev_fifo' into dev_fifo
commit
163e8c8b4d
@ -0,0 +1,68 @@
|
||||
package com.glxp.api.controller.dev;
|
||||
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.controller.BaseController;
|
||||
import com.glxp.api.entity.dev.DeviceCheckDetailEntity;
|
||||
import com.glxp.api.req.dev.*;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.res.dev.DeviceRepairApplyDetailMiniResponse;
|
||||
import com.glxp.api.service.dev.DeviceCheckDetailService;
|
||||
import com.glxp.api.service.dev.DeviceRepairApplyDetailService;
|
||||
import groovy.util.logging.Slf4j;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping
|
||||
@RequiredArgsConstructor
|
||||
public class DeviceMiniController extends BaseController {
|
||||
|
||||
private final DeviceRepairApplyDetailService deviceRepairApplyDetailService;
|
||||
private final DeviceCheckDetailService deviceCheckDetailService;
|
||||
|
||||
/**
|
||||
* 获取明细报修单列表分页
|
||||
*
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/udi/device/repair/apply/detail/mini/page")
|
||||
public BaseResponse miniPage(@RequestBody @Valid DeviceRepairApplyDetailMiniQuery query) {
|
||||
List<DeviceRepairApplyDetailMiniResponse> list = deviceRepairApplyDetailService.miniPage(query);
|
||||
PageInfo pageInfo = new PageInfo<>(list);
|
||||
PageSimpleResponse page = new PageSimpleResponse();
|
||||
page.setTotal(pageInfo.getTotal());
|
||||
page.setList(pageInfo.getList());
|
||||
return ResultVOUtils.success(page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 巡检任务单明细列表
|
||||
*
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/udi/device/check/detail/mini/page")
|
||||
public BaseResponse miniPage(@RequestBody @Valid DeviceCheckDetailMiniQuery query) {
|
||||
List<DeviceCheckDetailEntity> list = deviceCheckDetailService.miniPage(query);
|
||||
PageInfo pageInfo = new PageInfo<>(list);
|
||||
PageSimpleResponse page = new PageSimpleResponse();
|
||||
page.setTotal(pageInfo.getTotal());
|
||||
page.setList(pageInfo.getList());
|
||||
return ResultVOUtils.success(page);
|
||||
}
|
||||
}
|
@ -0,0 +1,223 @@
|
||||
package com.glxp.api.controller.purchase;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.glxp.api.annotation.RepeatSubmit;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.entity.purchase.PurContractDetailEntity;
|
||||
import com.glxp.api.entity.purchase.PurContractEntity;
|
||||
import com.glxp.api.entity.purchase.PurPlanEntity;
|
||||
import com.glxp.api.req.purchase.*;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.res.purchase.PurContractEntityResponse;
|
||||
import com.glxp.api.service.auth.CustomerService;
|
||||
import com.glxp.api.service.basic.SysApprovalFlowService;
|
||||
import com.glxp.api.service.purchase.impl.PurContractDetailService;
|
||||
import com.glxp.api.service.purchase.impl.PurContractService;
|
||||
import com.glxp.api.service.system.SystemParamConfigService;
|
||||
import com.glxp.api.util.GennerOrderUtils;
|
||||
import com.glxp.api.util.OrderNoTypeBean;
|
||||
import jodd.util.StringUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class PurContractController {
|
||||
|
||||
@Resource
|
||||
PurContractService purContractService;
|
||||
@Resource
|
||||
PurContractDetailService purContractDetailService;
|
||||
@Resource
|
||||
private GennerOrderUtils gennerOrderUtils;
|
||||
@Resource
|
||||
private SysApprovalFlowService sysApprovalFlowService;
|
||||
@Resource
|
||||
CustomerService customerService;
|
||||
@Resource
|
||||
SystemParamConfigService systemParamConfigService;
|
||||
|
||||
final String type = "cght";
|
||||
|
||||
/**
|
||||
* 草稿保存
|
||||
*/
|
||||
@PostMapping("/purchase/contract/postOrder")
|
||||
public BaseResponse postOrder(@RequestBody PostPurContractRequest postPurPlanRequest) {
|
||||
|
||||
Long userId = customerService.getUserId();
|
||||
PurContractEntity purContractEntity = postPurPlanRequest.getPurContractEntity();
|
||||
|
||||
Date date = new Date();
|
||||
purContractEntity.setUpdateTime(date);
|
||||
purContractEntity.setUpdateUser(userId + "");
|
||||
purContractEntity.setStatus(postPurPlanRequest.getEditStatus()); //状态
|
||||
|
||||
Integer editStatus = postPurPlanRequest.getEditStatus();
|
||||
|
||||
String code1 = purContractEntity.getCode();
|
||||
if (StringUtil.isEmpty(code1)) {
|
||||
String code = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean("HT", "yyyyMMdd"));
|
||||
purContractEntity.setCode(code);
|
||||
}
|
||||
|
||||
Boolean sys_approval_flow = "1".equals(systemParamConfigService.selectValueByParamKey("sys_approval_flow"));
|
||||
if (editStatus == 2 && sys_approval_flow){//提交审核
|
||||
String approvalFlowId = sysApprovalFlowService.getApprovalFlowId();
|
||||
purContractEntity.setApprovalFlowId(approvalFlowId);
|
||||
sysApprovalFlowService.generateFlow(approvalFlowId,purContractEntity.getCode(),type);
|
||||
}
|
||||
|
||||
|
||||
if (purContractEntity.getId() == null) {
|
||||
purContractEntity.setCreateTime(date);
|
||||
purContractEntity.setCreateUser(userId + "");
|
||||
purContractService.save(purContractEntity);
|
||||
} else {
|
||||
purContractService.updateById(purContractEntity);
|
||||
}
|
||||
return ResultVOUtils.success("提交成功!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询采购合同列表
|
||||
*/
|
||||
@GetMapping("/purchase/contract/list")
|
||||
public BaseResponse list(PurContractRequest purContractRequest) {
|
||||
|
||||
Boolean sys_approval_flow = "1".equals(systemParamConfigService.selectValueByParamKey("sys_approval_flow"));
|
||||
purContractRequest.setSysApprovalFlow(sys_approval_flow);
|
||||
|
||||
IPage<PurContractEntityResponse> page = purContractService.queryPageList(purContractRequest);
|
||||
PageSimpleResponse<PurContractEntityResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(page.getTotal());
|
||||
pageSimpleResponse.setList(page.getRecords());
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询采购合同详情列表
|
||||
*
|
||||
* @param purContractDetailRequest
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/purchase/contract/list/detail")
|
||||
public BaseResponse getDetailList(PurContractDetailRequest purContractDetailRequest) {
|
||||
IPage<PurContractDetailEntity> page = purContractDetailService.queryPageList(purContractDetailRequest);
|
||||
PageSimpleResponse<PurContractDetailEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(page.getTotal());
|
||||
pageSimpleResponse.setList(page.getRecords());
|
||||
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改采购合同详情
|
||||
*/
|
||||
@PostMapping("/purchase/contract/updateDetail")
|
||||
public BaseResponse detailEdit(@RequestBody PurContractDetailEntity purPlanDetailEntity) {
|
||||
purContractDetailService.updateById(purPlanDetailEntity);
|
||||
return ResultVOUtils.success("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加产品到合同里面
|
||||
*/
|
||||
@PostMapping("/purchase/contract/addContractDetail")
|
||||
public BaseResponse addContractDetail(@RequestBody AddPurPlanDetailRequest addPurPlanDetailRequest) {
|
||||
|
||||
int falg = purContractDetailService.insert(addPurPlanDetailRequest);
|
||||
if (falg > 0) {
|
||||
return ResultVOUtils.success("添加成功");
|
||||
} else {
|
||||
return ResultVOUtils.success("添加失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增合同
|
||||
*/
|
||||
@PostMapping("purchase/addContractDetail/add")
|
||||
public BaseResponse add() {
|
||||
Long userId = customerService.getUserId();
|
||||
PurContractEntity purContractEntity = new PurContractEntity();
|
||||
Date date = new Date();
|
||||
purContractEntity.setCreateUser(userId + "");
|
||||
purContractEntity.setCreateTime(date);
|
||||
purContractEntity.setUpdateTime(date);
|
||||
purContractEntity.setUpdateUser(userId + "");
|
||||
purContractService.insert(purContractEntity);
|
||||
Long id = purContractEntity.getId();
|
||||
return ResultVOUtils.success(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除申购单和详情
|
||||
*/
|
||||
@PostMapping("/purchase/contract/delContractDetailAll")
|
||||
public BaseResponse delApplyDetailAll(@RequestBody PurContractEntity purContractEntity) {
|
||||
|
||||
if (purContractEntity.getId() != null) {
|
||||
purContractService.deleteById(purContractEntity.getId());
|
||||
purContractDetailService.deleteByOrderId(purContractEntity.getId());
|
||||
} else {
|
||||
return ResultVOUtils.error(999, "参数有误!");
|
||||
}
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除合同明细
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@DeleteMapping("/purchase/contract/detail/{ids}")
|
||||
public BaseResponse detailRemove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
|
||||
purContractDetailService.deleteByIds(Arrays.asList(ids));
|
||||
return ResultVOUtils.success("删除成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导入计划
|
||||
*/
|
||||
@PostMapping("/purchase/contract/importPlan")
|
||||
public BaseResponse importPlan(@RequestBody PurPlanEntity purPlanEntity) {
|
||||
|
||||
if (purPlanEntity.getId() != null) {
|
||||
purContractService.importPlan(purPlanEntity.getId(),purPlanEntity.getPageType());
|
||||
} else {
|
||||
return ResultVOUtils.error(999, "参数有误!");
|
||||
}
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 审核采购合同
|
||||
*/
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/purchase/contract/auditOrder")
|
||||
public BaseResponse auditOrder(@RequestBody PurContractRequest purContractRequest) {
|
||||
String code = purContractRequest.getCode();
|
||||
Integer status = purContractRequest.getStatus();
|
||||
if (StringUtil.isEmpty(code) || status == null){
|
||||
return ResultVOUtils.error(999, "参数有误!");
|
||||
}
|
||||
boolean b = purContractService.auditOrder(purContractRequest);
|
||||
return ResultVOUtils.success("更新成功!");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.glxp.api.dao.purchase;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.api.entity.purchase.PurContractDetailEntity;
|
||||
|
||||
public interface PurContractDetailMapper extends BaseMapper<PurContractDetailEntity> {
|
||||
|
||||
// int insert(PurContractDetailEntity purContractDetailEntity);
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.glxp.api.dao.purchase;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.glxp.api.entity.purchase.PurContractEntity;
|
||||
import com.glxp.api.req.purchase.PurContractRequest;
|
||||
import com.glxp.api.res.purchase.PurContractEntityResponse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface PurContractMapper extends BaseMapper<PurContractEntity> {
|
||||
@Override
|
||||
int insert(PurContractEntity purContractEntity);
|
||||
|
||||
Page<PurContractEntityResponse> selectPage(Page page, @Param("purContractRequest") PurContractRequest purContractRequest);
|
||||
}
|
@ -0,0 +1,170 @@
|
||||
package com.glxp.api.entity.purchase;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 采购合同表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "pur_contract")
|
||||
public class PurContractEntity implements Serializable {
|
||||
@TableId(value = "id", type = IdType.INPUT)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
@TableField(value = "code")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
@TableField(value = "`name`")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 往来单位/供应商
|
||||
*/
|
||||
@TableField(value = "fromCorp")
|
||||
private String fromCorp;
|
||||
|
||||
/**
|
||||
* 合同签订日期
|
||||
*/
|
||||
@TableField(value = "contractDate")
|
||||
private Date contractDate;
|
||||
|
||||
/**
|
||||
* 当前仓库
|
||||
*/
|
||||
@TableField(value = "invCode")
|
||||
private String invCode;
|
||||
|
||||
/**
|
||||
* 合同状态
|
||||
*/
|
||||
@TableField(value = "`status`")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 合同类型
|
||||
*/
|
||||
@TableField(value = "`type`")
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 付款方式
|
||||
*/
|
||||
@TableField(value = "payType")
|
||||
private String payType;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@TableField(value = "startDate")
|
||||
private Date startDate;
|
||||
|
||||
/**
|
||||
* 截止时间
|
||||
*/
|
||||
@TableField(value = "endDate")
|
||||
private Date endDate;
|
||||
|
||||
/**
|
||||
* 合同金额
|
||||
*/
|
||||
@TableField(value = "amount")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 实付金额
|
||||
*/
|
||||
@TableField(value = "payAmount")
|
||||
private BigDecimal payAmount;
|
||||
|
||||
/**
|
||||
* 付款日期
|
||||
*/
|
||||
@TableField(value = "payDate")
|
||||
private Date payDate;
|
||||
|
||||
/**
|
||||
* 开票日期
|
||||
*/
|
||||
@TableField(value = "invoiceDate")
|
||||
private Date invoiceDate;
|
||||
|
||||
/**
|
||||
* 采购计划ID外键
|
||||
*/
|
||||
@TableField(value = "planOrderIdFk")
|
||||
private String planOrderIdFk;
|
||||
|
||||
/**
|
||||
* 采购订单外键
|
||||
*/
|
||||
@TableField(value = "orderIdFk")
|
||||
private String orderIdFk;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(value = "`createUser`")
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(value = "updateUser")
|
||||
private String updateUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value = "createTime")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(value = "updateTime")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 审批表主键
|
||||
*/
|
||||
@TableField(value = "approvalFlowId")
|
||||
private String approvalFlowId;
|
||||
|
||||
/**
|
||||
* 是否生成订单 1.已生成;0.未生成
|
||||
*/
|
||||
@TableField(value = "isGenerateOrder")
|
||||
private Integer isGenerateOrder;
|
||||
|
||||
@TableField(value = "pageType")
|
||||
private Integer pageType;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.glxp.api.req.dev;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class DeviceCheckDetailMiniQuery extends ListPageRequest {
|
||||
|
||||
/**
|
||||
* 部门编码
|
||||
*/
|
||||
@NotBlank(message = "缺少部门编码")
|
||||
private String deptCode;
|
||||
|
||||
/**
|
||||
* 模糊设备码和UDI
|
||||
*/
|
||||
private String deviceCodeAndUdi;
|
||||
|
||||
/**
|
||||
* 是否完成
|
||||
*/
|
||||
private Boolean finishFlag;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.glxp.api.req.dev;
|
||||
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class DeviceRepairApplyDetailMiniQuery extends ListPageRequest {
|
||||
|
||||
/**
|
||||
* 部门编码
|
||||
*/
|
||||
@NotBlank(message = "缺少部门编码")
|
||||
private String deptCode;
|
||||
|
||||
/**
|
||||
* 模糊设备码和UDI
|
||||
*/
|
||||
private String deviceCodeAndUdi;
|
||||
|
||||
/**
|
||||
* 状态 待诊断、待维修、维修中、完成',
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.glxp.api.req.dev;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class DeviceRepairApplyListByIdAndCodeQuery {
|
||||
|
||||
@NotNull(message = "报修单标识不能为空")
|
||||
Long applyId;
|
||||
|
||||
/**
|
||||
* 报修人联系方式
|
||||
*/
|
||||
@NotBlank(message = "设备标识不可以为空")
|
||||
String deviceCode;
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.glxp.api.req.purchase;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
@Data
|
||||
public class AddPurPlanDetailRequest {
|
||||
|
||||
@NotEmpty(message ="产品id不可为空!")
|
||||
private String[] productIds;
|
||||
|
||||
/**
|
||||
* 采购计划ID外键
|
||||
*/
|
||||
@NotEmpty(message = "采购订单id不可为空!")
|
||||
private String orderIdFk;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.glxp.api.req.purchase;
|
||||
|
||||
import com.glxp.api.entity.purchase.PurContractDetailEntity;
|
||||
import com.glxp.api.entity.purchase.PurContractEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PostPurContractRequest {
|
||||
Integer editStatus;
|
||||
PurContractEntity purContractEntity;
|
||||
List<PurContractDetailEntity> purContractDetailEntities;
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.glxp.api.req.purchase;
|
||||
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class PurContractDetailRequest extends ListPageRequest {
|
||||
|
||||
/**
|
||||
* 合同外键
|
||||
*/
|
||||
@NotBlank(message = "合同外键不能为空")
|
||||
private String orderIdFk;
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.glxp.api.req.purchase;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PurContractRequest extends ListPageRequest {
|
||||
|
||||
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 合同状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 合同签订日期
|
||||
*/
|
||||
private String startDate;
|
||||
|
||||
/**
|
||||
* 合同签订日期
|
||||
*/
|
||||
private String endDate;
|
||||
|
||||
/**
|
||||
* 是否生成订单 1.已生成;0.未生成
|
||||
*/
|
||||
private Integer isGenerateOrder;
|
||||
|
||||
private Boolean sysApprovalFlow;
|
||||
|
||||
@TableField(value = "pageType")
|
||||
private Integer pageType;
|
||||
}
|
@ -0,0 +1,202 @@
|
||||
package com.glxp.api.res.dev;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.glxp.api.enums.dev.DeviceRepairApplyDetailStatusEnum;
|
||||
import com.glxp.api.enums.dev.DeviceRepairApplyStatusEnum;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class DeviceRepairApplyDetailMiniResponse {
|
||||
|
||||
/**
|
||||
* 报修单id
|
||||
*/
|
||||
@TableField(value = "applyId")
|
||||
private Long applyId;
|
||||
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
@TableField(value = "deviceCode")
|
||||
private String deviceCode;
|
||||
|
||||
/**
|
||||
* 部门编码
|
||||
*/
|
||||
@TableField(value = "deptCode")
|
||||
private String deptCode;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@TableField(value = "deptName")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
@TableField(value = "description")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 诊断信息
|
||||
*/
|
||||
@TableField(value = "diagnosisInfo")
|
||||
private String diagnosisInfo;
|
||||
|
||||
/**
|
||||
* 状态 待诊断、待维修、维修中、完成
|
||||
*/
|
||||
@TableField(value = "status")
|
||||
private DeviceRepairApplyDetailStatusEnum status;
|
||||
|
||||
/**
|
||||
* 是否需要维修 true/false
|
||||
*/
|
||||
@TableField(value = "repairFlag")
|
||||
private Boolean repairFlag;
|
||||
|
||||
/**
|
||||
* 维修单id
|
||||
*/
|
||||
@TableField(value = "repairId")
|
||||
private Long repairId;
|
||||
|
||||
/**
|
||||
* 产品id
|
||||
*/
|
||||
@TableField(value = "productId")
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* UDI码
|
||||
*/
|
||||
@TableField(value = "udi")
|
||||
private String udi;
|
||||
|
||||
/**
|
||||
* DI码
|
||||
*/
|
||||
@TableField(value = "nameCode")
|
||||
private String nameCode;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
@TableField(value = "productName")
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
@TableField(value = "ggxh")
|
||||
private String ggxh;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 报修单id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
// /**
|
||||
// * 状态 待受理,受理中,维修中,完成
|
||||
// */
|
||||
// @TableField(value = "status")
|
||||
// private DeviceRepairApplyStatusEnum status;
|
||||
|
||||
/**
|
||||
* 报修部门编码
|
||||
*/
|
||||
@TableField(value = "applyDeptCode")
|
||||
private String applyDeptCode;
|
||||
|
||||
/**
|
||||
* 报修部门
|
||||
*/
|
||||
@TableField(value = "applyDeptName")
|
||||
private String applyDeptName;
|
||||
|
||||
/**
|
||||
* 报修人id
|
||||
*/
|
||||
@TableField(value = "applyUserId")
|
||||
private Long applyUserId;
|
||||
|
||||
/**
|
||||
* 报修人姓名
|
||||
*/
|
||||
@TableField(value = "applyUserName")
|
||||
private String applyUserName;
|
||||
|
||||
/**
|
||||
* 报修人联系方式
|
||||
*/
|
||||
@TableField(value = "applyUserPhone")
|
||||
private String applyUserPhone;
|
||||
|
||||
/**
|
||||
* 报修时间
|
||||
*/
|
||||
@TableField(value = "applyTime")
|
||||
private LocalDateTime applyTime;
|
||||
|
||||
/**
|
||||
* 设备数量
|
||||
*/
|
||||
@TableField(value = "deviceCount")
|
||||
private Integer deviceCount;
|
||||
|
||||
/**
|
||||
* 完成数量
|
||||
*/
|
||||
@TableField(value = "finishCount")
|
||||
private Integer finishCount;
|
||||
|
||||
/**
|
||||
* 确认部门
|
||||
*/
|
||||
@TableField(value = "confirmDeptCode")
|
||||
private String confirmDeptCode;
|
||||
|
||||
/**
|
||||
* 确认部门名称
|
||||
*/
|
||||
@TableField(value = "confirmDeptName")
|
||||
private String confirmDeptName;
|
||||
|
||||
/**
|
||||
* 确认人id
|
||||
*/
|
||||
@TableField(value = "confirmUserId")
|
||||
private Long confirmUserId;
|
||||
|
||||
/**
|
||||
* 确认人姓名
|
||||
*/
|
||||
@TableField(value = "confirmUserName")
|
||||
private String confirmUserName;
|
||||
|
||||
/**
|
||||
* 确认人联系方式
|
||||
*/
|
||||
@TableField(value = "confirmPhone")
|
||||
private String confirmPhone;
|
||||
|
||||
/**
|
||||
* 确认时间
|
||||
*/
|
||||
@TableField(value = "confirmTime")
|
||||
private LocalDateTime confirmTime;
|
||||
|
||||
/**
|
||||
* 完成时间
|
||||
*/
|
||||
@TableField(value = "finishTime")
|
||||
private LocalDateTime finishTime;
|
||||
|
||||
}
|
@ -0,0 +1,174 @@
|
||||
package com.glxp.api.res.purchase;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 采购合同表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PurContractEntityResponse implements Serializable {
|
||||
@TableId(value = "id", type = IdType.INPUT)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
@TableField(value = "code")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
@TableField(value = "`name`")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 往来单位/供应商
|
||||
*/
|
||||
@TableField(value = "fromCorp")
|
||||
private String fromCorp;
|
||||
|
||||
/**
|
||||
* 合同签订日期
|
||||
*/
|
||||
@TableField(value = "contractDate")
|
||||
private Date contractDate;
|
||||
|
||||
/**
|
||||
* 当前仓库
|
||||
*/
|
||||
@TableField(value = "invCode")
|
||||
private String invCode;
|
||||
|
||||
/**
|
||||
* 合同状态
|
||||
*/
|
||||
@TableField(value = "`status`")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 合同类型
|
||||
*/
|
||||
@TableField(value = "`type`")
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 付款方式
|
||||
*/
|
||||
@TableField(value = "payType")
|
||||
private String payType;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@TableField(value = "startDate")
|
||||
private Date startDate;
|
||||
|
||||
/**
|
||||
* 截止时间
|
||||
*/
|
||||
@TableField(value = "endDate")
|
||||
private Date endDate;
|
||||
|
||||
/**
|
||||
* 合同金额
|
||||
*/
|
||||
@TableField(value = "amount")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 实付金额
|
||||
*/
|
||||
@TableField(value = "payAmount")
|
||||
private BigDecimal payAmount;
|
||||
|
||||
/**
|
||||
* 付款日期
|
||||
*/
|
||||
@TableField(value = "payDate")
|
||||
private Date payDate;
|
||||
|
||||
/**
|
||||
* 开票日期
|
||||
*/
|
||||
@TableField(value = "invoiceDate")
|
||||
private Date invoiceDate;
|
||||
|
||||
/**
|
||||
* 采购计划ID外键
|
||||
*/
|
||||
@TableField(value = "planOrderIdFk")
|
||||
private String planOrderIdFk;
|
||||
|
||||
/**
|
||||
* 采购订单外键
|
||||
*/
|
||||
@TableField(value = "orderIdFk")
|
||||
private String orderIdFk;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(value = "`createUser`")
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(value = "updateUser")
|
||||
private String updateUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value = "createTime")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(value = "updateTime")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 审批表主键
|
||||
*/
|
||||
@TableField(value = "approvalFlowId")
|
||||
private String approvalFlowId;
|
||||
|
||||
private String nextNodeName;
|
||||
|
||||
private Integer nextApprovalNodeType;
|
||||
/**
|
||||
* 是否生成订单 1.已生成;0.未生成
|
||||
*/
|
||||
@TableField(value = "isGenerateOrder")
|
||||
private Integer isGenerateOrder;
|
||||
|
||||
/**
|
||||
* 合同状态
|
||||
*/
|
||||
@TableField(value = "`flowStatus`")
|
||||
private Integer flowStatus;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,100 @@
|
||||
package com.glxp.api.service.purchase.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.glxp.api.dao.basic.BasicProductsDao;
|
||||
import com.glxp.api.dao.basic.UdiRlSupDao;
|
||||
import com.glxp.api.dao.purchase.PurContractDetailMapper;
|
||||
import com.glxp.api.entity.basic.BasicProductsEntity;
|
||||
import com.glxp.api.entity.basic.CompanyProductRelevanceEntity;
|
||||
import com.glxp.api.entity.purchase.PurContractDetailEntity;
|
||||
import com.glxp.api.req.basic.CompanyProductRelevanceRequest;
|
||||
import com.glxp.api.req.purchase.AddPurPlanDetailRequest;
|
||||
import com.glxp.api.req.purchase.PurContractDetailRequest;
|
||||
import com.glxp.api.res.basic.UdiRlSupResponse;
|
||||
import com.glxp.api.service.basic.UdiRlSupService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class PurContractDetailService extends ServiceImpl<PurContractDetailMapper, PurContractDetailEntity> {
|
||||
|
||||
@Resource
|
||||
PurContractDetailMapper purContractDetailMapper;
|
||||
@Resource
|
||||
UdiRlSupDao udiRlSupDao;
|
||||
|
||||
public int insert(AddPurPlanDetailRequest addPurPlanDetailRequest) {
|
||||
String orderIdFk = addPurPlanDetailRequest.getOrderIdFk();
|
||||
String[] ids = addPurPlanDetailRequest.getProductIds();
|
||||
if (ids.length > 0 ){
|
||||
CompanyProductRelevanceRequest companyProductRelevanceRequest = new CompanyProductRelevanceRequest();
|
||||
companyProductRelevanceRequest.setIds(Arrays.asList(ids));
|
||||
companyProductRelevanceRequest.setDiType(1);
|
||||
List<UdiRlSupResponse> entities = udiRlSupDao.filterUdiGp(companyProductRelevanceRequest);
|
||||
if (CollectionUtil.isNotEmpty(entities)){
|
||||
entities.forEach( x-> {
|
||||
PurContractDetailEntity purContractDetailEntity = new PurContractDetailEntity();
|
||||
BeanUtils.copyProperties(x,purContractDetailEntity);
|
||||
purContractDetailEntity.setOrderIdFk(orderIdFk);
|
||||
purContractDetailEntity.setProductId(x.getRlId());
|
||||
purContractDetailEntity.setProductUniqueId(x.getUuid());
|
||||
purContractDetailEntity.setNameCode(x.getNameCode());
|
||||
purContractDetailEntity.setProductName(x.getCpmctymc());
|
||||
purContractDetailEntity.setProductCompany(x.getManufactory());
|
||||
purContractDetailEntity.setZczbhhzbapzbh(x.getZczbhhzbapzbh());
|
||||
purContractDetailEntity.setGgxh(x.getGgxh());
|
||||
purContractDetailEntity.setPackRatio(x.getPackRatio());
|
||||
purContractDetailEntity.setSupId(x.getCustomerId());
|
||||
purContractDetailEntity.setSupName(x.getSupName());
|
||||
purContractDetailEntity.setCount(1);
|
||||
purContractDetailEntity.setPrice(new BigDecimal(StrUtil.isEmpty(x.getPrice())?"0":x.getPrice()));
|
||||
purContractDetailMapper.insert(purContractDetailEntity);
|
||||
});
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
public IPage<PurContractDetailEntity> queryPageList(PurContractDetailRequest purContractDetailRequest) {
|
||||
QueryWrapper<PurContractDetailEntity> wrapper = buildPurContractDetailQueryWrapper(purContractDetailRequest);
|
||||
IPage<PurContractDetailEntity> page = new Page<>(purContractDetailRequest.getPage(), purContractDetailRequest.getLimit());
|
||||
return purContractDetailMapper.selectPage(page, wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造查询条件
|
||||
*
|
||||
* @param purContractDetailRequest
|
||||
* @return
|
||||
*/
|
||||
private QueryWrapper<PurContractDetailEntity> buildPurContractDetailQueryWrapper(PurContractDetailRequest purContractDetailRequest) {
|
||||
QueryWrapper<PurContractDetailEntity> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq(StrUtil.isNotBlank(purContractDetailRequest.getOrderIdFk()), "orderIdFk", purContractDetailRequest.getOrderIdFk())
|
||||
.orderByDesc("id");
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
public int deleteByOrderId(Long id) {
|
||||
UpdateWrapper<PurContractDetailEntity> uw = new UpdateWrapper<>();
|
||||
uw.eq("orderIdFk",id);
|
||||
return purContractDetailMapper.delete(uw);
|
||||
}
|
||||
|
||||
public int deleteByIds(List<Long> asList) {
|
||||
UpdateWrapper<PurContractDetailEntity> uw = new UpdateWrapper<>();
|
||||
uw.in("id",asList);
|
||||
return purContractDetailMapper.delete(uw);
|
||||
}
|
||||
}
|
@ -0,0 +1,127 @@
|
||||
package com.glxp.api.service.purchase.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.glxp.api.dao.purchase.PurContractDetailMapper;
|
||||
import com.glxp.api.dao.purchase.PurContractMapper;
|
||||
import com.glxp.api.dao.purchase.PurPlanDao;
|
||||
import com.glxp.api.dao.purchase.PurPlanDetailDao;
|
||||
import com.glxp.api.entity.purchase.PurContractDetailEntity;
|
||||
import com.glxp.api.entity.purchase.PurContractEntity;
|
||||
import com.glxp.api.entity.purchase.PurPlanDetailEntity;
|
||||
import com.glxp.api.entity.purchase.PurPlanEntity;
|
||||
import com.glxp.api.req.purchase.PurApplyDetailRequest;
|
||||
import com.glxp.api.req.purchase.PurContractRequest;
|
||||
import com.glxp.api.req.purchase.PurPlanDetailRequest;
|
||||
import com.glxp.api.res.purchase.PurContractEntityResponse;
|
||||
import com.glxp.api.res.purchase.PurOrderDetailResponse;
|
||||
import com.glxp.api.service.auth.CustomerService;
|
||||
import com.glxp.api.util.GennerOrderUtils;
|
||||
import com.glxp.api.util.OrderNoTypeBean;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class PurContractService extends ServiceImpl<PurContractMapper, PurContractEntity> {
|
||||
|
||||
@Resource
|
||||
PurContractMapper purContractMapper;
|
||||
@Resource
|
||||
PurPlanDetailService purPlanDetailService;
|
||||
@Resource
|
||||
PurPlanDao purPlanDao;
|
||||
@Resource
|
||||
private GennerOrderUtils gennerOrderUtils;
|
||||
@Resource
|
||||
PurContractDetailMapper purContractDetailMapper;
|
||||
@Resource
|
||||
CustomerService customerService;
|
||||
|
||||
public IPage<PurContractEntityResponse> queryPageList(PurContractRequest purContractRequest) {
|
||||
IPage<PurContractEntityResponse> purPlanEntities = purContractMapper.selectPage(purContractRequest.getPageObj(),purContractRequest);
|
||||
return purPlanEntities;
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// * 构造查询条件
|
||||
// *
|
||||
// * @param purContractRequest
|
||||
// * @return
|
||||
// */
|
||||
// private QueryWrapper<PurContractEntity> buildPurContractQueryWrapper(PurContractRequest purContractRequest) {
|
||||
// QueryWrapper<PurContractEntity> wrapper = new QueryWrapper<>();
|
||||
// wrapper.like(StrUtil.isNotBlank(purContractRequest.getCode()), "code", purContractRequest.getCode())
|
||||
// .like(StrUtil.isNotBlank(purContractRequest.getName()), "name", purContractRequest.getName())
|
||||
// .eq(ObjectUtil.isNotNull(purContractRequest.getStatus()), "status", purContractRequest.getStatus())
|
||||
// .ge(StrUtil.isNotBlank(purContractRequest.getStartDate()), "contractDate", purContractRequest.getStartDate())
|
||||
// .le(StrUtil.isNotBlank(purContractRequest.getEndDate()), "contractDate", purContractRequest.getEndDate())
|
||||
// .orderByDesc("id");
|
||||
// return wrapper;
|
||||
// }
|
||||
|
||||
public int insert(PurContractEntity purContractEntity) {
|
||||
return purContractMapper.insert(purContractEntity);
|
||||
}
|
||||
|
||||
public int deleteById(Long id) {
|
||||
return purContractMapper.deleteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入计划
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
public void importPlan(Long id,Integer pageType) {
|
||||
PurPlanEntity purPlanEntity = purPlanDao.selectById(id);
|
||||
PurPlanDetailRequest purApplyDetailRequest = new PurPlanDetailRequest();
|
||||
purApplyDetailRequest.setOrderIdFk(String.valueOf(id));
|
||||
List<PurOrderDetailResponse> purPlanDetailEntities = purPlanDetailService.joinQueryList(purApplyDetailRequest);
|
||||
|
||||
PurContractEntity purContractEntity = new PurContractEntity();
|
||||
BeanUtils.copyProperties(purPlanEntity, purContractEntity);
|
||||
Long userId = customerService.getUserId();
|
||||
purContractEntity.setCreateUser(userId + "");
|
||||
purContractEntity.setCreateTime(new Date());
|
||||
purContractEntity.setUpdateTime(new Date());
|
||||
purContractEntity.setUpdateUser(userId + "");
|
||||
purContractEntity.setStatus(1); //状态
|
||||
|
||||
String code = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean("HT", "yyyyMMdd"));
|
||||
purContractEntity.setCode(code);
|
||||
purContractEntity.setId(null);
|
||||
purContractEntity.setPageType(pageType);
|
||||
purContractMapper.insert(purContractEntity);
|
||||
Long newId = purContractEntity.getId();
|
||||
|
||||
if (purPlanDetailEntities.size() > 0){
|
||||
purPlanDetailEntities.forEach( item -> {
|
||||
PurContractDetailEntity purContractDetailEntity = new PurContractDetailEntity();
|
||||
BeanUtils.copyProperties(item,purContractDetailEntity);
|
||||
purContractDetailEntity.setOrderIdFk(String.valueOf(newId));
|
||||
purContractDetailMapper.insert(purContractDetailEntity);
|
||||
});
|
||||
}
|
||||
|
||||
purPlanEntity.setImportStatus(1);
|
||||
purPlanDao.updateById(purPlanEntity);
|
||||
}
|
||||
|
||||
public boolean auditOrder(PurContractRequest purContractRequest) {
|
||||
Long userId = customerService.getUserId();
|
||||
String code = purContractRequest.getCode();
|
||||
PurContractEntity one = super.getOne(new LambdaQueryWrapper<>(PurContractEntity.class).eq(PurContractEntity::getCode, code));
|
||||
one.setUpdateTime(new Date());
|
||||
one.setUpdateUser(userId + "");
|
||||
one.setStatus(purContractRequest.getStatus());
|
||||
return super.updateById(one);
|
||||
}
|
||||
}
|
@ -1,323 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.glxp.api.dao.basic.SysApprovalFlowConfigMxMapper">
|
||||
<resultMap id="BaseResultMap" type="com.glxp.api.entity.basic.SysApprovalFlowConfigMx">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table sys_approval_flow_config_mx-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="approvalUserId" jdbcType="VARCHAR" property="approvalUserId" />
|
||||
<result column="approvalUserName" jdbcType="VARCHAR" property="approvalUserName" />
|
||||
<result column="approvalSort" jdbcType="INTEGER" property="approvalSort" />
|
||||
<result column="createUser" jdbcType="VARCHAR" property="createUser" />
|
||||
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="updateUser" jdbcType="VARCHAR" property="updateUser" />
|
||||
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, `type`, approvalUserId,approvalUserName, approvalSort, `createUser`, createTime, updateUser, updateTime
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
<!--@mbg.generated-->
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from sys_approval_flow_config_mx
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
<!--@mbg.generated-->
|
||||
delete from sys_approval_flow_config_mx
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.glxp.api.entity.basic.SysApprovalFlowConfigMx">
|
||||
<!--@mbg.generated-->
|
||||
insert into sys_approval_flow_config_mx (id, `type`, approvalUserId,approvalUserName,
|
||||
approvalSort, `createUser`, createTime,
|
||||
updateUser, updateTime)
|
||||
values (#{id,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{approvalUserId,jdbcType=VARCHAR}, #{approvalUserName,jdbcType=VARCHAR},
|
||||
#{approvalSort,jdbcType=INTEGER}, #{createUser,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{updateUser,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.glxp.api.entity.basic.SysApprovalFlowConfigMx">
|
||||
<!--@mbg.generated-->
|
||||
insert into sys_approval_flow_config_mx
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
`type`,
|
||||
</if>
|
||||
<if test="approvalUserId != null">
|
||||
approvalUserId,
|
||||
</if>
|
||||
<if test="approvalUserName != null">
|
||||
approvalUserName,
|
||||
</if>
|
||||
<if test="approvalSort != null">
|
||||
approvalSort,
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
`createUser`,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
createTime,
|
||||
</if>
|
||||
<if test="updateUser != null">
|
||||
updateUser,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
updateTime,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="approvalUserId != null">
|
||||
#{approvalUserId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="approvalUserName != null">
|
||||
#{approvalUserName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="approvalSort != null">
|
||||
#{approvalSort,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
#{createUser,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateUser != null">
|
||||
#{updateUser,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.glxp.api.entity.basic.SysApprovalFlowConfigMx">
|
||||
<!--@mbg.generated-->
|
||||
update sys_approval_flow_config_mx
|
||||
<set>
|
||||
<if test="type != null">
|
||||
`type` = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="approvalUserId != null">
|
||||
approvalUserId = #{approvalUserId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="approvalUserName != null">
|
||||
approvalUserName = #{approvalUserName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="approvalSort != null">
|
||||
approvalSort = #{approvalSort,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
`createUser` = #{createUser,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
createTime = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateUser != null">
|
||||
updateUser = #{updateUser,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.glxp.api.entity.basic.SysApprovalFlowConfigMx">
|
||||
<!--@mbg.generated-->
|
||||
update sys_approval_flow_config_mx
|
||||
set `type` = #{type,jdbcType=VARCHAR},
|
||||
approvalUserId = #{approvalUserId,jdbcType=VARCHAR},
|
||||
approvalUserName = #{approvalUserName,jdbcType=VARCHAR},
|
||||
approvalSort = #{approvalSort,jdbcType=INTEGER},
|
||||
`createUser` = #{createUser,jdbcType=VARCHAR},
|
||||
createTime = #{createTime,jdbcType=TIMESTAMP},
|
||||
updateUser = #{updateUser,jdbcType=VARCHAR},
|
||||
updateTime = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateBatch" parameterType="java.util.List">
|
||||
<!--@mbg.generated-->
|
||||
update sys_approval_flow_config_mx
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<trim prefix="`type` = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=VARCHAR} then #{item.type,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="approvalUserId = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=VARCHAR} then #{item.approvalUserId,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="approvalUserName = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=VARCHAR} then #{item.approvalUserName,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="approvalSort = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=VARCHAR} then #{item.approvalSort,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="`createUser` = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=VARCHAR} then #{item.createUser,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="createTime = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="updateUser = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=VARCHAR} then #{item.updateUser,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="updateTime = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
|
||||
</foreach>
|
||||
</trim>
|
||||
</trim>
|
||||
where id in
|
||||
<foreach close=")" collection="list" item="item" open="(" separator=", ">
|
||||
#{item.id,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</update>
|
||||
<insert id="batchInsert" parameterType="map">
|
||||
<!--@mbg.generated-->
|
||||
insert into sys_approval_flow_config_mx
|
||||
(id, `type`, approvalUserId, approvalUserName, approvalSort, `createUser`, createTime, updateUser,
|
||||
updateTime)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.id,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR}, #{item.approvalUserId,jdbcType=VARCHAR},
|
||||
#{item.approvalSort,jdbcType=INTEGER}, #{item.createUser,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
|
||||
#{item.updateUser,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="insertOrUpdate" parameterType="com.glxp.api.entity.basic.SysApprovalFlowConfigMx">
|
||||
<!--@mbg.generated-->
|
||||
insert into sys_approval_flow_config_mx
|
||||
(id, `type`, approvalUserId,approvalUserName, approvalSort, `createUser`, createTime, updateUser,
|
||||
updateTime)
|
||||
values
|
||||
(#{id,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{approvalUserId,jdbcType=VARCHAR},#{approvalUserName,jdbcType=VARCHAR},
|
||||
#{approvalSort,jdbcType=INTEGER}, #{createUser,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{updateUser,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP})
|
||||
on duplicate key update
|
||||
id = #{id,jdbcType=VARCHAR},
|
||||
`type` = #{type,jdbcType=VARCHAR},
|
||||
approvalUserId = #{approvalUserId,jdbcType=VARCHAR},
|
||||
approvalUserName = #{approvalUserName,jdbcType=VARCHAR},
|
||||
approvalSort = #{approvalSort,jdbcType=INTEGER},
|
||||
`createUser` = #{createUser,jdbcType=VARCHAR},
|
||||
createTime = #{createTime,jdbcType=TIMESTAMP},
|
||||
updateUser = #{updateUser,jdbcType=VARCHAR},
|
||||
updateTime = #{updateTime,jdbcType=TIMESTAMP}
|
||||
</insert>
|
||||
<insert id="insertOrUpdateSelective" parameterType="com.glxp.api.entity.basic.SysApprovalFlowConfigMx">
|
||||
<!--@mbg.generated-->
|
||||
insert into sys_approval_flow_config_mx
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
`type`,
|
||||
</if>
|
||||
<if test="approvalUserId != null">
|
||||
approvalUserId,
|
||||
</if>
|
||||
<if test="approvalUserName != null">
|
||||
approvalUserName,
|
||||
</if>
|
||||
<if test="approvalSort != null">
|
||||
approvalSort,
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
`createUser`,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
createTime,
|
||||
</if>
|
||||
<if test="updateUser != null">
|
||||
updateUser,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
updateTime,
|
||||
</if>
|
||||
</trim>
|
||||
values
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="approvalUserId != null">
|
||||
#{approvalUserId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="approvalUserName != null">
|
||||
#{approvalUserName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="approvalSort != null">
|
||||
#{approvalSort,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
#{createUser,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateUser != null">
|
||||
#{updateUser,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
on duplicate key update
|
||||
<trim suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id = #{id,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
`type` = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="approvalUserId != null">
|
||||
approvalUserId = #{approvalUserId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="approvalUserName != null">
|
||||
approvalUserName = #{approvalUserName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="approvalSort != null">
|
||||
approvalSort = #{approvalSort,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
`createUser` = #{createUser,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
createTime = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateUser != null">
|
||||
updateUser = #{updateUser,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.glxp.api.dao.purchase.PurContractDetailMapper">
|
||||
<resultMap id="BaseResultMap" type="com.glxp.api.entity.purchase.PurContractDetailEntity">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table pur_contract_detail-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="orderIdFk" jdbcType="VARCHAR" property="orderidfk" />
|
||||
<result column="productId" jdbcType="BIGINT" property="productid" />
|
||||
<result column="productUniqueId" jdbcType="VARCHAR" property="productuniqueid" />
|
||||
<result column="nameCode" jdbcType="VARCHAR" property="namecode" />
|
||||
<result column="batchNo" jdbcType="VARCHAR" property="batchno" />
|
||||
<result column="productName" jdbcType="VARCHAR" property="productname" />
|
||||
<result column="productCompany" jdbcType="VARCHAR" property="productcompany" />
|
||||
<result column="produceDate" jdbcType="DATE" property="producedate" />
|
||||
<result column="expireDate" jdbcType="DATE" property="expiredate" />
|
||||
<result column="zczbhhzbapzbh" jdbcType="VARCHAR" property="zczbhhzbapzbh" />
|
||||
<result column="ggxh" jdbcType="VARCHAR" property="ggxh" />
|
||||
<result column="packRatio" jdbcType="VARCHAR" property="packratio" />
|
||||
<result column="supId" jdbcType="BIGINT" property="supid" />
|
||||
<result column="supName" jdbcType="VARCHAR" property="supname" />
|
||||
<result column="count" jdbcType="INTEGER" property="count" />
|
||||
<result column="price" jdbcType="DECIMAL" property="price" />
|
||||
<result column="firstSalesInvNo" jdbcType="VARCHAR" property="firstsalesinvno" />
|
||||
<result column="secSalesInvNo" jdbcType="VARCHAR" property="secsalesinvno" />
|
||||
<result column="secSalesListNo" jdbcType="VARCHAR" property="secsaleslistno" />
|
||||
<result column="invoiceDate" jdbcType="VARCHAR" property="invoicedate" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, orderIdFk, productId, productUniqueId, nameCode, batchNo, productName, productCompany,
|
||||
produceDate, expireDate, zczbhhzbapzbh, ggxh, packRatio, supId, supName, `count`,
|
||||
price, firstSalesInvNo, secSalesInvNo, secSalesListNo, invoiceDate, remark
|
||||
</sql>
|
||||
|
||||
<insert id="insert" keyProperty="id"
|
||||
parameterType="com.glxp.api.entity.purchase.PurContractDetailEntity">
|
||||
replace
|
||||
INTO pur_contract_detail
|
||||
(
|
||||
orderIdFk,
|
||||
productId,
|
||||
productUniqueId,
|
||||
nameCode,
|
||||
batchNo,
|
||||
productName,
|
||||
productCompany,
|
||||
produceDate,
|
||||
expireDate,
|
||||
zczbhhzbapzbh,
|
||||
ggxh,
|
||||
packRatio,
|
||||
supId,
|
||||
supName,
|
||||
`count`,
|
||||
price,
|
||||
firstSalesInvNo,
|
||||
secSalesInvNo,
|
||||
secSalesListNo,
|
||||
invoiceDate,
|
||||
remark
|
||||
)
|
||||
values (
|
||||
#{orderIdFk},
|
||||
#{productId},
|
||||
#{productUniqueId},
|
||||
#{nameCode},
|
||||
#{batchNo},
|
||||
#{productName},
|
||||
#{productCompany},
|
||||
#{produceDate},
|
||||
#{expireDate},
|
||||
#{zczbhhzbapzbh},
|
||||
#{ggxh},
|
||||
#{packRatio},
|
||||
#{supId},
|
||||
#{supName},
|
||||
#{count},
|
||||
#{price},
|
||||
#{firstSalesInvNo},
|
||||
#{secSalesInvNo},
|
||||
#{secSalesListNo},
|
||||
#{invoiceDate},
|
||||
#{remark}
|
||||
)
|
||||
</insert>
|
||||
</mapper>
|
@ -0,0 +1,154 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.glxp.api.dao.purchase.PurContractMapper">
|
||||
<resultMap id="BaseResultMap" type="com.glxp.api.entity.purchase.PurContractEntity">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table pur_contract-->
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="code" jdbcType="VARCHAR" property="code" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="fromCorp" jdbcType="VARCHAR" property="fromCorp" />
|
||||
<result column="contractDate" jdbcType="TIMESTAMP" property="contractDate" />
|
||||
<result column="invCode" jdbcType="VARCHAR" property="invCode" />
|
||||
<result column="status" jdbcType="INTEGER" property="status" />
|
||||
<result column="type" jdbcType="INTEGER" property="type" />
|
||||
<result column="payType" jdbcType="INTEGER" property="payType" />
|
||||
<result column="startDate" jdbcType="TIMESTAMP" property="startDate" />
|
||||
<result column="endDate" jdbcType="TIMESTAMP" property="endDate" />
|
||||
<result column="amount" jdbcType="DECIMAL" property="amount" />
|
||||
<result column="payAmount" jdbcType="DECIMAL" property="payAmount" />
|
||||
<result column="payDate" jdbcType="TIMESTAMP" property="payDate" />
|
||||
<result column="invoiceDate" jdbcType="TIMESTAMP" property="invoiceDate" />
|
||||
<result column="planOrderIdFk" jdbcType="VARCHAR" property="planOrderIdFk" />
|
||||
<result column="orderIdFk" jdbcType="VARCHAR" property="orderIdFk" />
|
||||
<result column="createUser" jdbcType="VARCHAR" property="createUser" />
|
||||
<result column="updateUser" jdbcType="VARCHAR" property="updateUser" />
|
||||
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, code, `name`, fromCorp, contractDate, invCode, `status`, `type`, payType, startDate,
|
||||
endDate, amount, payAmount, payDate, invoiceDate, planOrderIdFk, orderIdFk, `createUser`,
|
||||
updateUser, createTime, updateTime, remark
|
||||
</sql>
|
||||
|
||||
<insert id="insert" keyProperty="id"
|
||||
parameterType="com.glxp.api.entity.purchase.PurPlanEntity" useGeneratedKeys="true">
|
||||
insert
|
||||
INTO pur_contract
|
||||
(
|
||||
code,
|
||||
`name`,
|
||||
fromCorp,
|
||||
contractDate,
|
||||
invCode,
|
||||
`status`,
|
||||
`type`,
|
||||
payType,
|
||||
startDate,
|
||||
endDate,
|
||||
amount,
|
||||
payAmount,
|
||||
payDate,
|
||||
invoiceDate,
|
||||
planOrderIdFk,
|
||||
orderIdFk,
|
||||
`createUser`,
|
||||
updateUser,
|
||||
createTime,
|
||||
updateTime,
|
||||
remark
|
||||
)
|
||||
values (
|
||||
#{code},
|
||||
#{name},
|
||||
#{fromCorp},
|
||||
#{contractDate},
|
||||
#{invCode},
|
||||
#{status},
|
||||
#{type},
|
||||
#{payType},
|
||||
#{startDate},
|
||||
#{endDate},
|
||||
#{amount},
|
||||
#{payAmount},
|
||||
#{payDate},
|
||||
#{invoiceDate},
|
||||
#{planOrderIdFk},
|
||||
#{orderIdFk},
|
||||
#{createUser},
|
||||
#{updateUser},
|
||||
#{createTime},
|
||||
#{updateTime},
|
||||
#{remark}
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
<select id="selectPage" parameterType="com.glxp.api.req.purchase.PurContractRequest"
|
||||
resultType="com.glxp.api.res.purchase.PurContractEntityResponse">
|
||||
select
|
||||
pc.id, pc.code, pc.`name`, pc.fromCorp, pc.contractDate, pc.invCode, pc.`type`, pc.payType, pc.startDate,
|
||||
pc.endDate, pc.amount, pc.payAmount, pc.payDate, pc.invoiceDate, pc.planOrderIdFk, pc.orderIdFk, pc.`createUser`,
|
||||
pc.updateUser, pc.createTime, pc.updateTime, pc.remark,pc.approvalFlowId,pc.isGenerateOrder,IFNULL(pc.status,0) as status,
|
||||
saf.status as flowStatus, saf.nextNodeName as nextNodeName , saf.nextApprovalNodeType as nextApprovalNodeType
|
||||
from pur_contract pc
|
||||
left join sys_approval_flow saf ON pc.approvalFlowId = saf.id
|
||||
<where>
|
||||
pc.code is not null
|
||||
<if test="!purContractRequest.sysApprovalFlow">
|
||||
<if test="purContractRequest.status != null and purContractRequest.status != 10 and purContractRequest.status != 11 and purContractRequest.status != 12 ">
|
||||
and pc.status = #{purContractRequest.status}
|
||||
</if>
|
||||
<if test="purContractRequest.status == 10">
|
||||
and (pc.status = 2 )
|
||||
</if>
|
||||
<if test="purContractRequest.status == 11">
|
||||
and (pc.status = 1 or pc.status is null )
|
||||
</if>
|
||||
<if test="purContractRequest.status == 12">
|
||||
and (pc.status = 3 or pc.status = 4)
|
||||
</if>
|
||||
</if>
|
||||
|
||||
<if test="purContractRequest.sysApprovalFlow">
|
||||
<if test="purContractRequest.status != null and purContractRequest.status != 10 and purContractRequest.status != 11 and purContractRequest.status != 12 ">
|
||||
and saf.status = #{purContractRequest.status}
|
||||
</if>
|
||||
<if test="purContractRequest.status == 10">
|
||||
and (saf.status = 2)
|
||||
</if>
|
||||
<if test="purContractRequest.status == 11">
|
||||
and (saf.status = 1 or saf.status is null)
|
||||
</if>
|
||||
<if test="purContractRequest.status == 12">
|
||||
and (saf.status = 3 or saf.status = 4)
|
||||
</if>
|
||||
</if>
|
||||
|
||||
<if test="purContractRequest.code != null and purContractRequest.code != ''" >
|
||||
and pc.code like concat('%',#{purContractRequest.code},'%')
|
||||
</if>
|
||||
<if test="purContractRequest.name != null and purContractRequest.name != ''" >
|
||||
and pc.name like concat('%',#{purContractRequest.name},'%')
|
||||
</if>
|
||||
<if test="purContractRequest.isGenerateOrder != null " >
|
||||
and pc.isGenerateOrder = #{purContractRequest.isGenerateOrder}
|
||||
</if>
|
||||
<if test="purContractRequest.startDate != null and purContractRequest.startDate != ''">
|
||||
AND pc.contractDate <![CDATA[>=]]> #{purContractRequest.startDate}
|
||||
</if>
|
||||
<if test="purContractRequest.endDate != null and purContractRequest.endDate != ''">
|
||||
AND pc.contractDate <![CDATA[<=]]> #{purContractRequest.endDate}
|
||||
</if>
|
||||
<if test="purContractRequest.pageType != null ">
|
||||
AND pc.pageType = #{purContractRequest.pageType}
|
||||
</if>
|
||||
order by id desc
|
||||
</where>
|
||||
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue