Merge remote-tracking branch 'origin/dev' into dev

dev
1178634255 2 years ago
commit 853fe6e897

@ -42,11 +42,11 @@ public class ReplaceBatch extends AbstractMethod {
CustomerSqlMethod sqlMethod = CustomerSqlMethod.REPLACE_ONE;
List<TableFieldInfo> fieldList = tableInfo.getFieldList();
String columnScript = SqlScriptUtils.convertTrim(tableInfo.getAllInsertSqlColumnMaybeIf(null),
LEFT_BRACKET, RIGHT_BRACKET, null, COMMA);
// String insertSqlColumn = tableInfo.getKeyInsertSqlColumn(true, true) +
// this.filterTableFieldInfo(fieldList, predicate, TableFieldInfo::getInsertSqlColumn, EMPTY);
// String columnScript = LEFT_BRACKET + insertSqlColumn.substring(0, insertSqlColumn.length() - 1) + RIGHT_BRACKET;
// String columnScript = SqlScriptUtils.convertTrim(tableInfo.getAllInsertSqlColumnMaybeIf(null),
// LEFT_BRACKET, RIGHT_BRACKET, null, COMMA);
String insertSqlColumn = tableInfo.getKeyInsertSqlColumn(true, true) +
this.filterTableFieldInfo(fieldList, predicate, TableFieldInfo::getInsertSqlColumn, EMPTY);
String columnScript = LEFT_BRACKET + insertSqlColumn.substring(0, insertSqlColumn.length() - 1) + RIGHT_BRACKET;
String insertSqlProperty = tableInfo.getKeyInsertSqlProperty(true, ENTITY_DOT, true) +
this.filterTableFieldInfo(fieldList, predicate, i -> i.getInsertSqlProperty(ENTITY_DOT), EMPTY);
insertSqlProperty = LEFT_BRACKET + insertSqlProperty.substring(0, insertSqlProperty.length() - 1) + RIGHT_BRACKET;

@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.annotation.Log;
@ -80,6 +81,7 @@ public class IoOrderController extends BaseController {
@Resource
IoOrderInvoiceService orderInvoiceService;
/**
*
*
@ -784,4 +786,68 @@ public class IoOrderController extends BaseController {
return ResultVOUtils.success();
}
@AuthRuleAnnotation("")
@GetMapping("/udiwms/inout/order/filterInvoiceList")
public BaseResponse filterInvoiceList(FilterOrderRequest filterOrderRequest) {
//这个不等于空表示要查询发票对应的单据
if (filterOrderRequest.getInvoiceEncode() != null) {
//查询发票详情
QueryWrapper<IoOrderInvoiceEntity> ew=new QueryWrapper<IoOrderInvoiceEntity>();
ew.eq("invoiceEncode",filterOrderRequest.getInvoiceEncode());
List<IoOrderInvoiceEntity> ioOrderInvoiceEntity = orderInvoiceService.list(ew);
List<String> orderIds = ioOrderInvoiceEntity.stream().map(IoOrderInvoiceEntity::getOrderIdFk).collect(Collectors.toList());
filterOrderRequest.setOrderIds(orderIds);
}
if (StrUtil.isNotBlank(filterOrderRequest.getStatusType())) {
orderService.setFilterStatus(filterOrderRequest);
}
if (StrUtil.isNotBlank(filterOrderRequest.getVueType())) {
orderService.setActions(filterOrderRequest);
}
if (StrUtil.isNotEmpty(filterOrderRequest.getSupInoivceSearch())) {
orderService.setInvoiceFiltes(filterOrderRequest);
}
if (filterOrderRequest.getSourceLocalType() != null) {
if (filterOrderRequest.getSourceLocalType() == 1) {
filterOrderRequest.setSourceTypes(Arrays.asList(1, 2, 3, 4, 5));
} else {
filterOrderRequest.setSourceTypes(Arrays.asList(6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17));
}
}
String customerId = getCustomerId();
if (!customerId.equals("110")) {
filterOrderRequest.setFromCorp(customerId);
}
List<IoOrderResponse> list = orderService.getfilterOrderList(filterOrderRequest);
for (IoOrderResponse ioOrderResponse : list) {
if (ioOrderResponse.getCheckStatus() == null) {
ioOrderResponse.setCheckStatus(0 + "");
}
orderInvoiceService.findRegStausByBillNo(ioOrderResponse);
}
if (filterOrderRequest.getInvoiceEncode() == null) {
//查询已被登记的单据
List<IoOrderInvoiceEntity> ioOrderInvoiceEntity = orderInvoiceService.list();
//已被选择的单据做标记
if (ioOrderInvoiceEntity != null && ioOrderInvoiceEntity.size() > 0) {
for (IoOrderResponse ioOrderResponse : list) {
for (IoOrderInvoiceEntity orderInvoiceEntity : ioOrderInvoiceEntity) {
if (ioOrderResponse.getBillNo().equals(orderInvoiceEntity.getOrderIdFk())) {
ioOrderResponse.setCheckType(true);
break;
}
}
}
}
}
PageInfo<IoOrderResponse> pageInfo = new PageInfo<>(list);
return ResultVOUtils.page(pageInfo);
}
}

@ -252,7 +252,9 @@ public class IoOrderDetailResultController extends BaseController {
i++;
}
String param = JSON.toJSONString(list);
data.put("data", list);
String param = JSON.toJSONString(data);
JasperUtils.jasperReport(request, response, param, filePath + "pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf");
return ResultVOUtils.success();
}

@ -1,6 +1,7 @@
package com.glxp.api.controller.inout;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
@ -9,15 +10,21 @@ import com.glxp.api.annotation.Log;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
import com.glxp.api.entity.inout.IoOrderDetailCodeEntity;
import com.glxp.api.entity.inout.IoOrderEntity;
import com.glxp.api.entity.inout.IoOrderInvoiceEntity;
import com.glxp.api.req.inout.FilterOrderDetailCodeRequest;
import com.glxp.api.req.inout.IoOrderInvoiceRequest;
import com.glxp.api.req.inout.RefreshInoiceRequest;
import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.res.inout.IoOrderDetailCodeResponse;
import com.glxp.api.res.inout.IoOrderInvoiceResponse;
import com.glxp.api.res.inout.IoOrderResponse;
import com.glxp.api.res.inout.RefreshInoiceResponse;
import com.glxp.api.service.auth.CustomerService;
import com.glxp.api.service.inout.IoOrderDetailBizService;
import com.glxp.api.service.inout.IoOrderDetailCodeService;
import com.glxp.api.service.inout.impl.IoOrderInvoiceService;
import org.springframework.beans.BeanUtils;
@ -27,6 +34,9 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@RestController
@ -35,7 +45,10 @@ public class IoOrderInvoiceController {
IoOrderInvoiceService ioOrderInvoiceService;
@Resource
IoOrderDetailCodeService orderDetailCodeService;
@Resource
CustomerService customerService;
@Resource
IoOrderDetailBizService orderDetailBizService;
@AuthRuleAnnotation("")
@PostMapping("/udiwms/inout/order/refrshInvoice")
@ -64,13 +77,22 @@ public class IoOrderInvoiceController {
return ResultVOUtils.page(pageInfo);
}
//发票对应产品信息汇总
@AuthRuleAnnotation("")
@GetMapping("/udiwms/inout/invoice/product/detail")
public BaseResponse productDetail(IoOrderInvoiceRequest orderInvoiceRequest) {
if (StrUtil.isEmpty(orderInvoiceRequest.getInvoiceEncode()))
return ResultVOUtils.error(500, "发票编码不能为空!");
List<IoOrderInvoiceResponse> orderInvoiceEntities = ioOrderInvoiceService.filterGroupBy(orderInvoiceRequest);
List<IoOrderInvoiceResponse> orderInvoiceEntities = ioOrderInvoiceService.filterInvoice(orderInvoiceRequest);
//计算金额
for (IoOrderInvoiceResponse orderInvoiceEntity : orderInvoiceEntities) {
if (orderInvoiceEntity.getPrice() != null && orderInvoiceEntity.getReCount() != 0) {
orderInvoiceEntity.setAmout(new BigDecimal(orderInvoiceEntity.getPrice()).multiply(new BigDecimal(orderInvoiceEntity.getReCount())));
}
}
PageInfo<IoOrderInvoiceResponse> pageInfo = new PageInfo<>(orderInvoiceEntities);
return ResultVOUtils.page(pageInfo);
}
@ -80,6 +102,9 @@ public class IoOrderInvoiceController {
@GetMapping("/udiwms/inout/invoice/order/detail")
public BaseResponse orderDetail(IoOrderInvoiceRequest orderInvoiceRequest) {
List<IoOrderResponse> orderInvoiceEntities = ioOrderInvoiceService.filterByInvoiceCode(orderInvoiceRequest);
for (IoOrderResponse orderInvoiceEntity : orderInvoiceEntities) {
ioOrderInvoiceService.findRegStausByBillNo(orderInvoiceEntity);
}
PageInfo<IoOrderResponse> pageInfo = new PageInfo<>(orderInvoiceEntities);
return ResultVOUtils.page(pageInfo);
}
@ -98,5 +123,74 @@ public class IoOrderInvoiceController {
return ResultVOUtils.error(500, "删除失败!");
}
@AuthRuleAnnotation("")
@PostMapping("/udiwms/inout/invoice/saveInvoice")
@Log(title = "发票增加", businessType = BusinessType.INSERT)
public BaseResponse saveInvoice(@RequestBody IoOrderInvoiceRequest ioOrderInvoiceRequest) {
List<String> orderFkList = ioOrderInvoiceRequest.getOrderFkList();
List<IoOrderInvoiceEntity> ioOrderInvoiceEntityList = new ArrayList<>();
for (String orderFk : orderFkList) {
//查询单据详情
FilterOrderDetailCodeRequest orderDetailBizRequest = new FilterOrderDetailCodeRequest();
orderDetailBizRequest.setOrderIdFk(orderFk);
List<IoOrderDetailCodeResponse> ioOrderDetailCodeResponses = orderDetailBizService.getfilterOrderList(orderDetailBizRequest);
for (IoOrderDetailCodeResponse ioOrderDetailCodeRespons : ioOrderDetailCodeResponses) {
IoOrderInvoiceEntity ioOrderInvoiceEntity = new IoOrderInvoiceEntity();
BeanUtils.copyProperties(ioOrderInvoiceRequest, ioOrderInvoiceEntity);
ioOrderInvoiceEntity.setId(IdUtil.getSnowflakeNextId());
ioOrderInvoiceEntity.setOrderIdFk(orderFk);
ioOrderInvoiceEntity.setUpdateTime(new Date());
ioOrderInvoiceEntity.setCreateTime(new Date());
ioOrderInvoiceEntity.setCreateUser(customerService.getUserId() + "");
ioOrderInvoiceEntity.setUpdateUser(customerService.getUserId() + "");
ioOrderInvoiceEntity.setBindRlFk(ioOrderDetailCodeRespons.getBindRlFk() + "");
ioOrderInvoiceEntity.setBatchNo(ioOrderDetailCodeRespons.getBatchNo());
ioOrderInvoiceEntity.setProductDate(ioOrderDetailCodeRespons.getProductDate());
ioOrderInvoiceEntity.setExpireDate(ioOrderDetailCodeRespons.getExpireDate());
ioOrderInvoiceEntityList.add(ioOrderInvoiceEntity);
}
}
boolean b = ioOrderInvoiceService.saveBatch(ioOrderInvoiceEntityList);
if (b)
return ResultVOUtils.success("选入成功!");
else
return ResultVOUtils.error(500, "选入失败!");
}
@PostMapping("/udiwms/inout/invoice/uploadInvoice")
@Log(title = "发票管理", businessType = BusinessType.UPDATE)
public BaseResponse uploadInvoice(@RequestBody IoOrderInvoiceEntity ioOrderInvoice) {
List<IoOrderInvoiceEntity> ioOrderInvoiceEntityList=ioOrderInvoiceService.list(new QueryWrapper<IoOrderInvoiceEntity>().eq("invoiceEncode",ioOrderInvoice.getInvoiceEncode()));
for (IoOrderInvoiceEntity ioOrderInvoiceEntity : ioOrderInvoiceEntityList) {
ioOrderInvoiceEntity.setInvoiceDate(ioOrderInvoice.getInvoiceDate());
ioOrderInvoiceEntity.setPrice(ioOrderInvoice.getPrice());
ioOrderInvoiceEntity.setLicenseUrl(ioOrderInvoice.getLicenseUrl());
ioOrderInvoiceEntity.setRemark(ioOrderInvoice.getRemark());
ioOrderInvoiceEntity.setMachineNo(ioOrderInvoice.getMachineNo());
ioOrderInvoiceEntity.setInvoiceCode(ioOrderInvoice.getInvoiceCode());
ioOrderInvoiceEntity.setUpdateTime(new Date());
}
ioOrderInvoiceService.updateBatchById(ioOrderInvoiceEntityList);
return ResultVOUtils.success("成功");
}
@AuthRuleAnnotation("")
@PostMapping("/udiwms/inout/invoice/deleteInvoiceByOrderFk")
@Log(title = "发票删除", businessType = BusinessType.DELETE)
public BaseResponse deleteInvoiceByOrderFk(@RequestBody DeleteRequest deleteRequest) {
if (StrUtil.isEmpty(deleteRequest.getInvoiceEncode()))
return ResultVOUtils.error(500, "发票编码不能为空");
boolean b = ioOrderInvoiceService.remove(new QueryWrapper<IoOrderInvoiceEntity>().eq("invoiceEncode", deleteRequest.getInvoiceEncode()).eq("orderIdFk",deleteRequest.getBillNo()));
if (b)
return ResultVOUtils.success("删除成功!");
else
return ResultVOUtils.error(500, "删除失败!");
}
}

@ -19,6 +19,8 @@ public interface IoOrderInvoiceMapper extends BaseMapperPlus<IoOrderInvoiceMappe
List<IoOrderInvoiceResponse> filterGroupBy(IoOrderInvoiceRequest orderInvoiceRequest);
List<IoOrderInvoiceResponse> filterInvoice(IoOrderInvoiceRequest orderInvoiceRequest);
List<IoOrderResponse> filterByInvoiceCode(IoOrderInvoiceRequest orderInvoiceRequest);
}

@ -190,4 +190,6 @@ public class FilterOrderRequest extends ListPageRequest {
private List<String> invoiceActions2;
private String orderBy;
private String invoiceEncode;
}

@ -70,6 +70,18 @@ public class IoOrderInvoiceRequest extends ListPageRequest {
private Long bizIdFk;
List<String> orderFkList;
/**
*
*/
private String startTime;
/**
*
*/
private String endTime;
public static final String COL_ID = "id";
public static final String COL_ORDERIDFK = "orderIdFk";

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ -88,6 +89,16 @@ public class IoOrderInvoiceResponse {
private Long bizIdFk;
private String coName;
private String spec;
private String measname;
private String manufacturer;
private String certCode;
private int reCount;
private int count;
private BigDecimal amout;
public static final String COL_ID = "id";
public static final String COL_ORDERIDFK = "orderIdFk";

@ -255,6 +255,9 @@ public class IoOrderResponse {
private int invoiceStatus;//发票登记状态0未登记1未全部登记2已全部登记
private boolean checkType;
public String getFromName() {

@ -117,6 +117,14 @@ public class IoOrderInvoiceService extends ServiceImpl<IoOrderInvoiceMapper, IoO
return ioOrderInvoiceMapper.filterGroupBy(orderInvoiceRequest);
}
public List<IoOrderInvoiceResponse> filterInvoice(IoOrderInvoiceRequest orderInvoiceRequest) {
if (orderInvoiceRequest.getPage() != null) {
int offset = (orderInvoiceRequest.getPage() - 1) * orderInvoiceRequest.getLimit();
PageHelper.offsetPage(offset, orderInvoiceRequest.getLimit());
}
return ioOrderInvoiceMapper.filterInvoice(orderInvoiceRequest);
}
public List<IoOrderResponse> filterByInvoiceCode(IoOrderInvoiceRequest orderInvoiceRequest) {
if (orderInvoiceRequest.getPage() != null) {

@ -37,12 +37,89 @@
<select id="filterGroupBy" parameterType="com.glxp.api.req.inout.IoOrderInvoiceRequest"
resultType="com.glxp.api.res.inout.IoOrderInvoiceResponse">
SELECT ic.*
SELECT
ic.id,
ic.orderIdFk,
ic.bindRlFk,
ic.batchNo,
ic.productDate,
ic.expireDate,
ic.machineNo,
ic.invoiceCode,
ic.invoiceEncode,
ic.invoiceDate,
ic.updateTime,
ic.createUser,
ic.createTime,
ic.updateUser,
ic.remark,
ic.licenseUrl,
ic.bizIdFk,
io.coName,
ic.price,
io.spec,
bp.measname,
io.manufacturer,
io.certCode,
io.reCount,
io.count
FROM io_order_invoice ic
inner join io_order io on ic.orderIdFk = io.billNo
INNER JOIN io_order_detail_code io ON ic.orderIdFk = io.orderIdFk
LEFT JOIN basic_udirel bu
ON bu.id = ic.bindRlFk
LEFT JOIN basic_products bp ON bu.uuid = bp.uuid
<where>
<if test="invoiceCode != null and invoiceCode != ''">
AND ic.invoiceCode = #{invoiceCode}
</if>
<if test="machineNo != null and invoiceCode != ''">
AND ic.machineNo = #{machineNo}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND date_format(ic.invoiceDate, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d')
</if>
<if test="invoiceEncode != null and invoiceEncode != ''">
AND ic.invoiceEncode = #{invoiceEncode}
</if>
</where>
GROUP BY ic.invoiceEncode
order by ic.updateTime desc
</select>
<select id="filterInvoice" parameterType="com.glxp.api.req.inout.IoOrderInvoiceRequest"
resultType="com.glxp.api.res.inout.IoOrderInvoiceResponse">
SELECT
ic.id,
ic.orderIdFk,
ic.bindRlFk,
ic.batchNo,
ic.productDate,
ic.expireDate,
ic.machineNo,
ic.invoiceCode,
ic.invoiceEncode,
ic.invoiceDate,
ic.updateTime,
ic.createUser,
ic.createTime,
ic.updateUser,
ic.remark,
ic.licenseUrl,
ic.bizIdFk,
io.coName,
io.price,
io.spec,
bp.measname,
io.manufacturer,
io.certCode,
io.reCount,
io.count
FROM io_order_invoice ic
INNER JOIN io_order_detail_code io ON ic.orderIdFk = io.orderIdFk
LEFT JOIN basic_udirel bu
ON bu.id = ic.bindRlFk
LEFT JOIN basic_products bp ON bu.uuid = bp.uuid
<where>
<if test="orderIdFk != null and orderIdFk != ''">
AND ic.orderIdFk = #{orderIdFk}
@ -53,9 +130,15 @@
<if test="batchNo != null and batchNo != ''">
AND ic.batchNo = #{batchNo}
</if>
<if test="invoiceEncode != null and invoiceEncode != ''">
AND ic.invoiceEncode = #{invoiceEncode}
</if>
</where>
GROUP BY ic.invoiceEncode
GROUP BY io.orderIdFk
order by ic.updateTime desc
</select>
<select id="filterByInvoiceCode" parameterType="com.glxp.api.req.inout.IoOrderInvoiceRequest"
resultType="com.glxp.api.res.inout.IoOrderResponse">
select io.*,

Loading…
Cancel
Save