Commit ecc8ad25 by 高晓磊

新增散客类型销售记录

parent 76f82f5d
...@@ -201,7 +201,7 @@ public class RetailInfoServiceImpl implements RetailInfoService { ...@@ -201,7 +201,7 @@ public class RetailInfoServiceImpl implements RetailInfoService {
KObject object = bean.newInstance(); KObject object = bean.newInstance();
object.set("purchaseAmount",dealAmount); object.set("purchaseAmount",dealAmount);
object.set("master",retailInfoDao.load(orGet.getUuid("id"))); object.set("master",retailInfoDao.load(orGet.getUuid("id")));
object.set("dinasType",dinasTypeDao.load(object.get("dinasType").getUuid(BaseConstants.ID))); object.set("dinasType",dinasType);
object.set(BaseConstants.ID,UUID.randomUUID()); object.set(BaseConstants.ID,UUID.randomUUID());
retailInfoDao.saveOrUpdate(object); retailInfoDao.saveOrUpdate(object);
......
...@@ -265,6 +265,9 @@ public class InventoryServiceImpl implements InventoryService { ...@@ -265,6 +265,9 @@ public class InventoryServiceImpl implements InventoryService {
List<KObject> itemListByStationId = inventoryDao.getItemListByStationId(stationId); List<KObject> itemListByStationId = inventoryDao.getItemListByStationId(stationId);
List<StationDinasTypeRelation> result = new ArrayList<>(); List<StationDinasTypeRelation> result = new ArrayList<>();
for(KObject item : itemListByStationId) { for(KObject item : itemListByStationId) {
if(item.getBigDecimal("price")==null || item.getBigDecimal("price").compareTo(BigDecimal.ZERO)<1){
continue;
}
StationDinasTypeRelation r = new StationDinasTypeRelation(); StationDinasTypeRelation r = new StationDinasTypeRelation();
r.setStationId(item.get("station").getUuid("id")); r.setStationId(item.get("station").getUuid("id"));
r.setStationName(item.get("station").getString("stationName")); r.setStationName(item.get("station").getString("stationName"));
......
...@@ -619,6 +619,7 @@ public class SalesPlanServiceImpl implements SalesPlanService { ...@@ -619,6 +619,7 @@ public class SalesPlanServiceImpl implements SalesPlanService {
//本周期分配量 //本周期分配量
stringObjectHashMap.put("planAmount", saleTempDetail.getBigDecimal("salesPlanAmount")); stringObjectHashMap.put("planAmount", saleTempDetail.getBigDecimal("salesPlanAmount"));
stringObjectHashMap.put("salePlanId", saleTempDetail.get("master").getUuid("id")); stringObjectHashMap.put("salePlanId", saleTempDetail.get("master").getUuid("id"));
stringObjectHashMap.put("salePlanDetailId", saleTempDetail.getUuid("id"));
//获取砂石今日库存 //获取砂石今日库存
//库存id //库存id
UUID id = inventory.getUuid("id"); UUID id = inventory.getUuid("id");
...@@ -685,6 +686,7 @@ public class SalesPlanServiceImpl implements SalesPlanService { ...@@ -685,6 +686,7 @@ public class SalesPlanServiceImpl implements SalesPlanService {
UUID uuid = a.get("master").getUuid("id"); UUID uuid = a.get("master").getUuid("id");
stringObjectHashMap.put("planAmount", planAmount); stringObjectHashMap.put("planAmount", planAmount);
stringObjectHashMap.put("salePlanId", uuid); stringObjectHashMap.put("salePlanId", uuid);
stringObjectHashMap.put("salePlanDetailId", a.getUuid("id"));
}); });
//获取砂石今日库存 //获取砂石今日库存
if(!stringObjectHashMap.containsKey("planAmount")){ if(!stringObjectHashMap.containsKey("planAmount")){
......
...@@ -98,7 +98,7 @@ public class SalesRecordServiceImpl implements SalesRecordService { ...@@ -98,7 +98,7 @@ public class SalesRecordServiceImpl implements SalesRecordService {
salesRecord.set(SalesRecordConstant.TARE_WEIGHT_PERSON, salesRecordInfo.getTareWeightPerson()); salesRecord.set(SalesRecordConstant.TARE_WEIGHT_PERSON, salesRecordInfo.getTareWeightPerson());
salesRecord.set(SalesRecordConstant.SYNCTIME, thentime); salesRecord.set(SalesRecordConstant.SYNCTIME, thentime);
salesRecord.set(SalesRecordConstant.DEALBILLCODE, salesRecordInfo.getDealBillCode()); salesRecord.set(SalesRecordConstant.DEALBILLCODE, salesRecordInfo.getDealBillCode());
salesRecord.set(SalesRecordConstant.CARINFO, salesRecordInfo.getCarInfo()); salesRecord.set(SalesRecordConstant.CARINFO, salesRecordInfo.getCarNum());
salesRecord.set(SalesRecordConstant.PRICE, salesRecordInfo.getPrice()); salesRecord.set(SalesRecordConstant.PRICE, salesRecordInfo.getPrice());
salesRecord.set(SalesRecordConstant.PAYMENTSOURCE, salesRecordInfo.getPaymentSource()); salesRecord.set(SalesRecordConstant.PAYMENTSOURCE, salesRecordInfo.getPaymentSource());
salesRecord.set(SalesRecordConstant.TRANSPORT_TYPE, salesRecordInfo.getTransportType()); salesRecord.set(SalesRecordConstant.TRANSPORT_TYPE, salesRecordInfo.getTransportType());
...@@ -106,12 +106,13 @@ public class SalesRecordServiceImpl implements SalesRecordService { ...@@ -106,12 +106,13 @@ public class SalesRecordServiceImpl implements SalesRecordService {
salesRecord.set(SalesRecordConstant.SALE_TYPE, saleType); salesRecord.set(SalesRecordConstant.SALE_TYPE, saleType);
salesRecord.set(SalesRecordConstant.REGIONALCOMPANY, regionalCompany); salesRecord.set(SalesRecordConstant.REGIONALCOMPANY, regionalCompany);
salesRecord.set(SalesRecordConstant.DINASTYPE, dinasType); salesRecord.set(SalesRecordConstant.DINASTYPE, dinasType);
salesRecord.set(SalesRecordConstant.CARINFO, salesRecordInfo.getCarInfo()); salesRecord.set(SalesRecordConstant.AMOUNT, salesRecordInfo.getAmount());
salesRecord.set(SalesRecordConstant.DEALAMOUNT, salesRecordInfo.getDealAmount());
//如果是散客则全部新增 //如果是散客则全部新增
if (2 == saleType) { if (2 == saleType) {
salesRecord.set(SalesRecordConstant.CUSTOMERTYPE,CustomerTypeEnum.RetailInfo.name()); salesRecord.set(SalesRecordConstant.CUSTOMERTYPE,CustomerTypeEnum.RetailInfo.name());
retailInfoService.create(station, dinasType, salesRecordInfo.getRetailName(), salesRecordInfo.getCarInfo(), salesRecordInfo.getCarInfo(), salesRecordInfo.getDealAmount(), salesRecordInfo.getAmount()); retailInfoService.create(station, dinasType, salesRecordInfo.getCarNum(), salesRecordInfo.getRetailName(), salesRecordInfo.getCarNum(), salesRecordInfo.getDealAmount(), salesRecordInfo.getAmount());
} else { } else {
//如果不为2则必定有合同 项目 购砂单位 区域公司 //如果不为2则必定有合同 项目 购砂单位 区域公司
salesRecord.set(SalesRecordConstant.CUSTOMERTYPE,CustomerTypeEnum.PurchaseSandCompany.name()); salesRecord.set(SalesRecordConstant.CUSTOMERTYPE,CustomerTypeEnum.PurchaseSandCompany.name());
...@@ -139,7 +140,7 @@ public class SalesRecordServiceImpl implements SalesRecordService { ...@@ -139,7 +140,7 @@ public class SalesRecordServiceImpl implements SalesRecordService {
BigDecimal dealAmount = BigDecimal.ZERO.subtract(BigDecimal.valueOf(salesRecord.getDouble(SalesRecordConstant.DEALAMOUNT))); BigDecimal dealAmount = BigDecimal.ZERO.subtract(BigDecimal.valueOf(salesRecord.getDouble(SalesRecordConstant.DEALAMOUNT)));
BigDecimal amount; BigDecimal amount;
if (0==salesRecordInfo.getPaymentSource()) { if (Integer.valueOf(0).equals(salesRecordInfo.getPaymentSource())) {
amount = BigDecimal.ZERO.subtract(BigDecimal.valueOf(salesRecord.getDouble(SalesRecordConstant.AMOUNT))); amount = BigDecimal.ZERO.subtract(BigDecimal.valueOf(salesRecord.getDouble(SalesRecordConstant.AMOUNT)));
} else { } else {
amount = BigDecimal.ZERO; amount = BigDecimal.ZERO;
...@@ -158,13 +159,13 @@ public class SalesRecordServiceImpl implements SalesRecordService { ...@@ -158,13 +159,13 @@ public class SalesRecordServiceImpl implements SalesRecordService {
}else if(saleType==1) { }else if(saleType==1) {
// 为1时是需用计划和销售计划 // 为1时是需用计划和销售计划
KObject salesPlan = salesPlanDao.load(UUID.fromString(salesRecordInfo.getSalePlanId())); KObject salesPlan = salesPlanDao.load(UUID.fromString(salesRecordInfo.getSalePlanId()));
BigDecimal actualSaleTotalAmount = salesPlan.get("actualSaleTotalAmount") == null ? BigDecimal.ZERO: (salesPlan.getBigDecimal("actualSaleTotalAmount")); BigDecimal actualSaleTotalAmount = salesPlan.getBigDecimal("actualSaleTotalAmount") == null ? BigDecimal.ZERO: (salesPlan.getBigDecimal("actualSaleTotalAmount"));
salesPlan.set("actualSaleTotalAmount", actualSaleTotalAmount.subtract(dealAmount)); salesPlan.set("actualSaleTotalAmount", actualSaleTotalAmount.subtract(dealAmount));
salesPlanDao.update(salesPlan); salesPlanDao.update(salesPlan);
salesPlanDao.updateSalesPlanDetailAmount(salesRecordInfo.getSalePlanDetailId(),salesRecordInfo.getDealAmount()); salesPlanDao.updateSalesPlanDetailAmount(salesRecordInfo.getSalePlanDetailId(),salesRecordInfo.getDealAmount());
KObject needPlanDetail = needPlanDao.queryDetailById(UUID.fromString(salesRecordInfo.getNeedPlanDetailId())); KObject needPlanDetail = needPlanDao.queryDetailById(UUID.fromString(salesRecordInfo.getNeedPlanDetailId()));
if (needPlanDetail != null) { if (needPlanDetail != null) {
BigDecimal effectiveSale = needPlanDetail.get("effectiveSale") == null ? BigDecimal.ZERO : needPlanDetail.getBigDecimal("effectiveSale"); BigDecimal effectiveSale = needPlanDetail.getBigDecimal("effectiveSale") == null ? BigDecimal.ZERO : needPlanDetail.getBigDecimal("effectiveSale");
needPlanDetail.set("effectiveSale", effectiveSale.subtract(dealAmount)); needPlanDetail.set("effectiveSale", effectiveSale.subtract(dealAmount));
needPlanDao.update(needPlanDetail); needPlanDao.update(needPlanDetail);
} }
...@@ -202,6 +203,7 @@ public class SalesRecordServiceImpl implements SalesRecordService { ...@@ -202,6 +203,7 @@ public class SalesRecordServiceImpl implements SalesRecordService {
return salesRecordId.toString(); return salesRecordId.toString();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
throw new SyncException("销售台账信息存储报出错:" + e.getMessage()); throw new SyncException("销售台账信息存储报出错:" + e.getMessage());
} }
} }
......
package com.xyst.dinas.sales.web.info; package com.xyst.dinas.sales.web.info;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
...@@ -53,7 +54,7 @@ public class SalesRecordInfo { ...@@ -53,7 +54,7 @@ public class SalesRecordInfo {
/** /**
* 车辆信息 * 车辆信息
*/ */
private String carInfo; private String carNum;
/** /**
* 毛重时间 * 毛重时间
...@@ -68,11 +69,11 @@ public class SalesRecordInfo { ...@@ -68,11 +69,11 @@ public class SalesRecordInfo {
/** /**
* 皮重 * 皮重
*/ */
private String tareWeight; private BigDecimal tareWeight;
/** /**
* 毛重 * 毛重
*/ */
private String grossWeight; private BigDecimal grossWeight;
/** /**
* 毛重司磅员 * 毛重司磅员
*/ */
...@@ -210,14 +211,6 @@ public class SalesRecordInfo { ...@@ -210,14 +211,6 @@ public class SalesRecordInfo {
this.dealTime = dealTime; this.dealTime = dealTime;
} }
public String getCarInfo() {
return carInfo;
}
public void setCarInfo(String carInfo) {
this.carInfo = carInfo;
}
public Date getGrossWeightTime() { public Date getGrossWeightTime() {
return grossWeightTime; return grossWeightTime;
} }
...@@ -234,19 +227,19 @@ public class SalesRecordInfo { ...@@ -234,19 +227,19 @@ public class SalesRecordInfo {
this.tareWeightTime = tareWeightTime; this.tareWeightTime = tareWeightTime;
} }
public String getTareWeight() { public BigDecimal getTareWeight() {
return tareWeight; return tareWeight;
} }
public void setTareWeight(String tareWeight) { public void setTareWeight(BigDecimal tareWeight) {
this.tareWeight = tareWeight; this.tareWeight = tareWeight;
} }
public String getGrossWeight() { public BigDecimal getGrossWeight() {
return grossWeight; return grossWeight;
} }
public void setGrossWeight(String grossWeight) { public void setGrossWeight(BigDecimal grossWeight) {
this.grossWeight = grossWeight; this.grossWeight = grossWeight;
} }
...@@ -306,6 +299,14 @@ public class SalesRecordInfo { ...@@ -306,6 +299,14 @@ public class SalesRecordInfo {
this.salePlanDetailId = salePlanDetailId; this.salePlanDetailId = salePlanDetailId;
} }
public String getCarNum() {
return carNum;
}
public void setCarNum(String carNum) {
this.carNum = carNum;
}
public Double getDealAmount() { public Double getDealAmount() {
return dealAmount; return dealAmount;
} }
......
...@@ -87,44 +87,6 @@ ...@@ -87,44 +87,6 @@
<m:attribute> <m:attribute>
<m:annotations> <m:annotations>
<m:annotation> <m:annotation>
<m:type>javax.persistence.Column</m:type>
<m:properties>
<m:property>
<m:key>name</m:key>
<m:value>gross_weight_time</m:value>
</m:property>
</m:properties>
</m:annotation>
</m:annotations>
<m:id>ca273c9d-0981-4f6d-94b4-4a3b76742a1e</m:id>
<m:name>grossWeightTime</m:name>
<m:title>毛重时间</m:title>
<m:type>datetime</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>tare_weight_time</m:value>
</m:property>
</m:properties>
</m:annotation>
</m:annotations>
<m:id>ca273c9d-0981-4f6d-94b4-4a3b76742a1e</m:id>
<m:name>tareWeightTime</m:name>
<m:title>皮重时间</m:title>
<m:type>datetime</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>javax.persistence.ManyToOne</m:type> <m:type>javax.persistence.ManyToOne</m:type>
</m:annotation> </m:annotation>
<m:annotation> <m:annotation>
...@@ -360,6 +322,44 @@ ...@@ -360,6 +322,44 @@
<m:properties> <m:properties>
<m:property> <m:property>
<m:key>name</m:key> <m:key>name</m:key>
<m:value>gross_weight_time</m:value>
</m:property>
</m:properties>
</m:annotation>
</m:annotations>
<m:id>33dda8c2-be30-4edd-acda-a250eea496be</m:id>
<m:name>grossWeightTime</m:name>
<m:title>毛重时间</m:title>
<m:type>datetime</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>tare_weight_time</m:value>
</m:property>
</m:properties>
</m:annotation>
</m:annotations>
<m:id>ecfdaf26-7e34-4753-9dfb-f5e0a9789ef2</m:id>
<m:name>tareWeightTime</m:name>
<m:title>皮重时间</m:title>
<m:type>datetime</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>deal_time</m:value> <m:value>deal_time</m:value>
</m:property> </m:property>
</m:properties> </m:properties>
...@@ -417,78 +417,116 @@ ...@@ -417,78 +417,116 @@
<m:attribute> <m:attribute>
<m:annotations> <m:annotations>
<m:annotation> <m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type> <m:type>bcp.type.constraint.Numeric</m:type>
<m:value>20</m:value> <m:properties>
<m:property>
<m:key>precision</m:key>
<m:value>12</m:value>
</m:property>
<m:property>
<m:key>scale</m:key>
<m:value>4</m:value>
</m:property>
</m:properties>
</m:annotation> </m:annotation>
<m:annotation> <m:annotation>
<m:type>javax.persistence.Column</m:type> <m:type>javax.persistence.Column</m:type>
<m:properties> <m:properties>
<m:property> <m:property>
<m:key>name</m:key> <m:key>name</m:key>
<m:value>gross_weight_person</m:value> <m:value>deal_amount</m:value>
</m:property> </m:property>
</m:properties> </m:properties>
</m:annotation> </m:annotation>
</m:annotations> </m:annotations>
<m:id>9ed97388-563a-4634-a555-b56bb1664dd0</m:id> <m:id>d307fa81-7819-4216-887c-2a0fdffd3190</m:id>
<m:name>grossWeightPerson</m:name> <m:name>dealAmount</m:name>
<m:title>毛重司磅员</m:title> <m:title>净重</m:title>
<m:type>string</m:type> <m:type>fixnum</m:type>
<m:description></m:description> <m:description></m:description>
<m:default></m:default> <m:default></m:default>
</m:attribute> </m:attribute>
<m:attribute> <m:attribute>
<m:annotations> <m:annotations>
<m:annotation> <m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type>
<m:value>20</m:value>
</m:annotation>
<m:annotation>
<m:type>javax.persistence.Column</m:type> <m:type>javax.persistence.Column</m:type>
<m:properties> <m:properties>
<m:property> <m:property>
<m:key>name</m:key> <m:key>name</m:key>
<m:value>tare_weight_person</m:value> <m:value>sale_type</m:value>
</m:property> </m:property>
</m:properties> </m:properties>
</m:annotation> </m:annotation>
</m:annotations> </m:annotations>
<m:id>9ed97388-563a-4634-a555-b56bb1664dd0</m:id> <m:id>deccf7b5-4378-4573-b927-5fd413a22f11</m:id>
<m:name>tareWeightPerson</m:name> <m:name>saleType</m:name>
<m:title>皮重司磅员</m:title> <m:title>销售类型</m:title>
<m:type>string</m:type> <m:type>int</m:type>
<m:description></m:description> <m:description></m:description>
<m:default></m:default> <m:default></m:default>
</m:attribute> </m:attribute>
<m:attribute> <m:attribute>
<m:annotations> <m:annotations>
<m:annotation> <m:annotation>
<m:type>bcp.type.constraint.Numeric</m:type> <m:type>javax.persistence.Column</m:type>
<m:properties> <m:properties>
<m:property> <m:property>
<m:key>precision</m:key> <m:key>name</m:key>
<m:value>12</m:value> <m:value>transport_type</m:value>
</m:property> </m:property>
</m:properties>
</m:annotation>
</m:annotations>
<m:id>1d5e96fc-1a8a-4de5-956b-1f26ca610edb</m:id>
<m:name>transportType</m:name>
<m:title>运输类型</m:title>
<m:type>int</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>20</m:value>
</m:annotation>
<m:annotation>
<m:type>javax.persistence.Column</m:type>
<m:properties>
<m:property> <m:property>
<m:key>scale</m:key> <m:key>name</m:key>
<m:value>4</m:value> <m:value>gross_weight_person</m:value>
</m:property> </m:property>
</m:properties> </m:properties>
</m:annotation> </m:annotation>
</m:annotations>
<m:id>6da43868-9ade-4c8c-8184-4e4f2a585455</m:id>
<m:name>grossWeightPerson</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>20</m:value>
</m:annotation>
<m:annotation> <m:annotation>
<m:type>javax.persistence.Column</m:type> <m:type>javax.persistence.Column</m:type>
<m:properties> <m:properties>
<m:property> <m:property>
<m:key>name</m:key> <m:key>name</m:key>
<m:value>deal_amount</m:value> <m:value>tare_weight_person</m:value>
</m:property> </m:property>
</m:properties> </m:properties>
</m:annotation> </m:annotation>
</m:annotations> </m:annotations>
<m:id>d307fa81-7819-4216-887c-2a0fdffd3190</m:id> <m:id>9669004f-a72e-43df-94e7-401bde16bb11</m:id>
<m:name>dealAmount</m:name> <m:name>tareWeightPerson</m:name>
<m:title>销售数量</m:title> <m:title>皮重司磅员</m:title>
<m:type>fixnum</m:type> <m:type>string</m:type>
<m:description></m:description> <m:description></m:description>
<m:default></m:default> <m:default></m:default>
</m:attribute> </m:attribute>
......
...@@ -142,6 +142,4 @@ public class WeighbridgeSyncController { ...@@ -142,6 +142,4 @@ public class WeighbridgeSyncController {
return ResponseObj.success("查询成功",allDinasTypes); return ResponseObj.success("查询成功",allDinasTypes);
} }
} }
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