Commit 59c07450 by yanHeng

[新增] 异常数据接口

parent 6517ed45
......@@ -565,6 +565,37 @@
</m:function-definition>
<m:icon>iconfont iconcheliangliangfang1x</m:icon>
</m:function-node>
<m:function-node>
<m:id>dd4ab671-52ba-4040-bd65-7ba13786106a</m:id>
<m:name>exception_data</m:name>
<m:title>异常数据</m:title>
<m:index>1600</m:index>
<m:license></m:license>
<m:privilege></m:privilege>
<m:role></m:role>
<m:function-definition>
<m:view>function-exception-data</m:view>
<m:view-config></m:view-config>
</m:function-definition>
<m:icon>iconfont iconhetongzhihangfenxi1x</m:icon>
</m:function-node>
<m:function-node>
<m:id>db78d057-269e-4689-b3ea-f90642334060</m:id>
<m:name>exception_data_approval</m:name>
<m:title>异常数据审核</m:title>
<m:index>1700</m:index>
<m:license></m:license>
<m:privilege></m:privilege>
<m:role></m:role>
<m:function-definition>
<m:view>function-exception-data-approval</m:view>
<m:view-config></m:view-config>
</m:function-definition>
<m:icon>iconfont iconhetongzhihangfenxi1x</m:icon>
</m:function-node>
<m:function-node>
<m:id>e536e311-8d22-4730-b3d7-444fd718c883</m:id>
<m:name>self_pickup_car</m:name>
......
......@@ -134,7 +134,6 @@ public class SalesRecordDaoImpl implements SalesRecordDao, SalesRecordConstant {
KObject staff = AminoContextHolder.getContext().getStaff();
KObject kobject = (KObject) template.load(ENTITY, id);
kobject.set(BaseConstants.MODIFY_TIME, new Date());
kobject.set(BaseConstants.MODIFIER, staff);
kobject.set(SalesRecordConstant.DEL_REASON, delReason);
kobject.set(SalesRecordConstant.METHOD_TYPE, SalesRecordConstant.DEL_METHOD);
template.update(kobject);
......@@ -142,11 +141,9 @@ public class SalesRecordDaoImpl implements SalesRecordDao, SalesRecordConstant {
@Override
public void approval(KObject approObject) {
KObject staff = AminoContextHolder.getContext().getStaff();
KObject kobject = (KObject) template.load(ENTITY, approObject.getUuid(BaseConstants.ID));
kobject.set(BaseConstants.MODIFY_TIME, new Date());
kobject.set(BaseConstants.MODIFIER, staff);
kobject.set(SalesRecordConstant.APPROVE_STATE, Integer.valueOf(kobject.getString(SalesRecordConstant.APPROVE_STATE)));
kobject.set(SalesRecordConstant.APPROVE_STATE, Integer.valueOf(approObject.getString(SalesRecordConstant.APPROVE_STATE)));
//当前数据方法类型
Integer methodType = Integer.valueOf(approObject.getString(SalesRecordConstant.METHOD_TYPE));
......@@ -161,10 +158,10 @@ public class SalesRecordDaoImpl implements SalesRecordDao, SalesRecordConstant {
@Override
public void update(KObject kobject) {
KObject staff = AminoContextHolder.getContext().getStaff();
KObject id = load(kobject.getUuid("id"));
kobject.set(BaseConstants.CREATE_TIME, id.getDate(BaseConstants.CREATE_TIME));
kobject.set(BaseConstants.MODIFY_TIME, new Date());
kobject.set(BaseConstants.MODIFIER, staff);
kobject.set(BaseConstants.DEL, false);
template.update(kobject);
template.merge(kobject);
}
}
\ No newline at end of file
......@@ -383,10 +383,10 @@ public class SalesRecordServiceImpl implements SalesRecordService {
salesRecord.set(SalesRecordConstant.GROSS_WEIGHT, salesRecordVO.getGrossWeight());
salesRecord.set(SalesRecordConstant.TARE_WEIGHT, salesRecordVO.getTareWeight());
salesRecord.set(SalesRecordConstant.DEALAMOUNT, salesRecordVO.getGrossWeight().subtract(salesRecordVO.getTareWeight()));
salesRecord.set(SalesRecordConstant.GROSS_WEIGHT_TIME, salesRecordVO.getGrossWeightTime());
salesRecord.set(SalesRecordConstant.TARE_WEIGHT_TIME, salesRecordVO.getTareWeightTime());
salesRecord.set(SalesRecordConstant.GROSS_WEIGHT_TIME, salesRecordVO.getGrossWeightTimeInfo());
salesRecord.set(SalesRecordConstant.TARE_WEIGHT_TIME, salesRecordVO.getTareWeightTimeInfo());
salesRecord.set(SalesRecordConstant.SYNCTIME, thentime);
salesRecord.set(SalesRecordConstant.DEALTIME, salesRecordVO.getGrossWeightTime()); // 销售时间为毛重时间
salesRecord.set(SalesRecordConstant.DEALTIME, salesRecordVO.getGrossWeightTimeInfo()); // 销售时间为毛重时间
salesRecord.set(SalesRecordConstant.DEALBILLCODE, salesRecordVO.getDealBillCode()); //销售单号
salesRecord.set(SalesRecordConstant.CARINFO, salesRecordVO.getCarNum());
salesRecord.set(SalesRecordConstant.DATA_SOURCE, SalesRecordConstant.DATA_SOURCE_REN_GONG);
......@@ -408,7 +408,7 @@ public class SalesRecordServiceImpl implements SalesRecordService {
salesRecord.set(SalesRecordConstant.DEALAMOUNT, salesRecordVO.getDealAmount());
//如果是散客
if (null != salesRecordVO.getRetailName()) {
if (null != salesRecordVO.getRetailName() && ! "".equals(salesRecordVO.getRetailName())) {
salesRecord.set(SalesRecordConstant.CUSTOMERTYPE, CustomerTypeEnum.RetailInfo.name());
......@@ -447,6 +447,7 @@ public class SalesRecordServiceImpl implements SalesRecordService {
salesRecordId = salesRecordIds.toString();
}else {
salesRecord.set(BaseConstants.ID,UUID.fromString(salesRecordVO.getId()));
salesRecord.set("version",salesRecordVO.getVersion());
salesRecordDao.update(salesRecord);
salesRecordId = salesRecordVO.getId();
}
......@@ -456,7 +457,7 @@ public class SalesRecordServiceImpl implements SalesRecordService {
returnMap.put("id", salesRecordId);
returnMap.put("advanceBalance", advanceBalance1);
returnMap.put("message", "新增成功");
returnMap.put("message", "保存成功");
return returnMap;
} catch (Exception e) {
......@@ -494,7 +495,7 @@ public class SalesRecordServiceImpl implements SalesRecordService {
}
//判断是审核通过 还是驳回
if (null == kobject.getString(SalesRecordConstant.APPROVE_STATE)) {
if (null == kobject.getString(SalesRecordConstant.APPROVE_STATE) && kobject.getString(SalesRecordConstant.APPROVE_STATE).isEmpty()) {
return ResponseObj.error(400, "审核状态 must be not null!");
}
Integer approvalState = Integer.valueOf(kobject.getString(SalesRecordConstant.APPROVE_STATE));
......@@ -507,7 +508,7 @@ public class SalesRecordServiceImpl implements SalesRecordService {
//判断客户类型是否是区域公司 是否有合同
if(CustomerTypeEnum.PurchaseSandCompany.name().equals(salesRecordInfo.getString(SalesRecordConstant.CUSTOMERTYPE))){
//如果通过 //如果为预付款类型 进行 对金额进行操作
if(SalesRecordConstant.APPROVED.equals(approvalState) && PayMentSourceEnum.Advance.equals(payMentSource)){
if(SalesRecordConstant.APPROVED.equals(approvalState) && PayMentSourceEnum.Advance.name().equals(payMentSource)){
UUID contractId = salesRecordInfo.get("contract").getUuid("id");
UUID dinasTypeId = salesRecordInfo.get("dinasType").getUuid("id");
......
......@@ -58,6 +58,48 @@ public class SalesRecordController {
if (null == salesRecord.getStationId()) {
return ResponseObj.error(400, "请选择具体的场站");
}
if (null == salesRecord.getCarNum()) {
return ResponseObj.error(400, "车牌号不能为空");
}
if (null == salesRecord.getTareWeightTimeInfo()) {
return ResponseObj.error(400, "皮重时间不能为空");
}
if (null == salesRecord.getGrossWeightTimeInfo()) {
return ResponseObj.error(400, "毛重时间不能为空");
}
if (null == salesRecord.getCarNum()) {
return ResponseObj.error(400, "车牌号不能为空");
}
if (null == salesRecord.getDealBillCode()) {
return ResponseObj.error(400, "销售单号不能为空");
}
if (null == salesRecord.getDinasTypeId()) {
return ResponseObj.error(400, "请选择具体的砂石");
}
if (null == salesRecord.getGrossWeight()) {
return ResponseObj.error(400, "毛重不能为空");
}
if (null == salesRecord.getTareWeight()) {
return ResponseObj.error(400, "皮重不能为空");
}
if (null == salesRecord.getPrice()) {
return ResponseObj.error(400, "单价不能为空");
}
if (null == salesRecord.getAmount()) {
return ResponseObj.error(400, "总价不能为空");
}
if (null == salesRecord.getPaymentSource()) {
return ResponseObj.error(400, "收款类型不能为空");
}
if (null == salesRecord.getReason()) {
return ResponseObj.error(400, "原因不能为空");
}
KObject station = stationService.getById(UUID.fromString(salesRecord.getStationId()));
HashMap<String, Object> stringObjectHashMap = salesRecordService.saveSalesRecordInfo(salesRecord, station);
......
package com.xyst.dinas.sales.web.info;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
......@@ -68,6 +71,20 @@ public class SalesRecordInfo {
*/
private Date tareWeightTime;
/**
* 毛重时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date grossWeightTimeInfo;
/**
* 皮重时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date tareWeightTimeInfo;
/**
* 皮重
*/
......@@ -164,6 +181,33 @@ public class SalesRecordInfo {
//方法类型
private Integer methodType;
//版本号
private Integer version;
public Date getGrossWeightTimeInfo() {
return grossWeightTimeInfo;
}
public void setGrossWeightTimeInfo(Date grossWeightTimeInfo) {
this.grossWeightTimeInfo = grossWeightTimeInfo;
}
public Date getTareWeightTimeInfo() {
return tareWeightTimeInfo;
}
public void setTareWeightTimeInfo(Date tareWeightTimeInfo) {
this.tareWeightTimeInfo = tareWeightTimeInfo;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public String getId() {
return id;
}
......
......@@ -324,6 +324,16 @@
<type>int</type>
<description></description>
</field>
<field title='删除'>
<name>del</name>
<type>boolean</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
</customQuery>
</content>
</model>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-privilege">
<specification>1.0</specification>
<id>367fd08f-ad86-4931-957e-b9f98cf8c66d</id>
<name>com.xyst.dinas.sales.auth.ExceptionApprovalList</name>
<title>列表</title>
<define>bcp.authz.privilege</define>
<define-version>1.0.0</define-version>
<content>
<m:privilege>
<m:type>TOKEN</m:type>
<m:category>销售/异常数据审核(区域公司)</m:category>
<m:seq>0</m:seq>
</m:privilege>
</content>
</metadata>
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-privilege">
<specification>1.0</specification>
<id>313913f0-ff31-4ecf-989c-78353a754d68</id>
<name>com.xyst.dinas.sales.auth.ExceptionList</name>
<title>新建</title>
<define>bcp.authz.privilege</define>
<define-version>1.0.0</define-version>
<content>
<m:privilege>
<m:type>TOKEN</m:type>
<m:category>销售/异常数据(区域公司)</m:category>
<m:seq>1</m:seq>
</m:privilege>
</content>
</metadata>
......@@ -704,6 +704,94 @@
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type>
<m:value>50</m:value>
</m:annotation>
<m:annotation>
<m:type>javax.persistence.Column</m:type>
<m:properties>
<m:property>
<m:key>name</m:key>
<m:value>data_source</m:value>
</m:property>
</m:properties>
</m:annotation>
</m:annotations>
<m:id>80dd565a-8a2e-4661-b89b-5384ebafd73c</m:id>
<m:name>dataSource</m:name>
<m:title>数据来源</m:title>
<m:type>string</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type>
<m:value>50</m:value>
</m:annotation>
<m:annotation>
<m:type>javax.persistence.Column</m:type>
<m:properties>
<m:property>
<m:key>name</m:key>
<m:value>reason</m:value>
</m:property>
</m:properties>
</m:annotation>
</m:annotations>
<m:id>988d3d4c-1062-41e0-94b9-bd339718330d</m:id>
<m:name>reason</m:name>
<m:title>原因</m:title>
<m:type>string</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type>
<m:value>50</m:value>
</m:annotation>
<m:annotation>
<m:type>javax.persistence.Column</m:type>
<m:properties>
<m:property>
<m:key>name</m:key>
<m:value>del_reason</m:value>
</m:property>
</m:properties>
</m:annotation>
</m:annotations>
<m:id>e7ca1203-2dfe-4ef0-b6a6-c204aa9a04da</m:id>
<m:name>delReason</m:name>
<m:title>删除原因</m:title>
<m:type>string</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>javax.persistence.Column</m:type>
<m:properties>
<m:property>
<m:key>name</m:key>
<m:value>method_type</m:value>
</m:property>
</m:properties>
</m:annotation>
</m:annotations>
<m:id>76cb3a45-d1ef-4ac7-ade5-3c3c34c21811</m:id>
<m:name>methodType</m:name>
<m:title>数据方法类型 0:新增 1:删除</m:title>
<m:type>int</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
</m:attributes>
</m:class>
</content>
......
......@@ -389,6 +389,66 @@
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>dataSource</m:name>
<m:title>数据来源</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>reason</m:name>
<m:title>原因</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>delReason</m:name>
<m:title>删除原因</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>approveState</m:name>
<m:title>审批状态</m:title>
<m:type>int</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>methodType</m:name>
<m:title>方法类型</m:title>
<m:type>int</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>del</m:name>
<m:title>删除</m:title>
<m:type>boolean</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
</m:fields>
</m:query>
</content>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment