Commit a38de63d by 高晓磊

销售汇总信息去掉购砂单位

parent 79e55a7b
......@@ -9,6 +9,7 @@ import com.beecode.inz.basis.internal.dao.AbstractBaseDao;
import com.beecode.inz.common.BaseConstants;
import com.beecode.inz.common.util.DateTimeUtils;
import com.xyst.dinas.biz.dao.DinasTypeDao;
import com.xyst.dinas.biz.enumeration.OrganizationTypeEnum;
import com.xyst.dinas.production.constant.ProductionPlanReportConstant;
import com.xyst.dinas.production.dao.ProductionPlanReportDao;
import org.hibernate.criterion.*;
......@@ -170,8 +171,10 @@ public class ProductionPlanReportDaoImpl extends AbstractBaseDao implements Prod
detachedCriteria.add(Restrictions.le("master.productionPlanDate", startDate));
}
KObject currentLoginRegionalCompany = dinasTypeDao.getCurrentLoginRegionalCompany();
detachedCriteria.add(Restrictions.eq("master.regionalCompany.id", currentLoginRegionalCompany.getUuid("id")))
.add(Restrictions.eq("master.del", false));
if (currentLoginRegionalCompany != null && currentLoginRegionalCompany. getString("type").equals(OrganizationTypeEnum.REGIONAL_COMPANY.name())) {
detachedCriteria.add(Restrictions.eq("master.regionalCompany.id", currentLoginRegionalCompany.getUuid("id")));
}
detachedCriteria.add(Restrictions.eq("master.del", false));
detachedCriteria.setProjection(Projections.projectionList()
.add(Projections.alias(Projections.rowCount(), "count"))
.add(Projections.alias(Projections.avg("dinasWeight"), "avgDinasWeight"))
......
......@@ -67,7 +67,7 @@ public class SandMiningServiceImpl implements SandMiningService {
warnSetting1.setBillId(uuid);
warnSetting1.setTarget(SandMiningAreaConstant.SAND_SHIP_WARN_TARGET_NO_OPERATING_HOURS);
warnSetting1.setOpen(true);
warnSetting1.setTargetType(WarnTargetTypeEnum.TIME_TYPE.getName());
warnSetting1.setTargetType(WarnTargetTypeEnum.TIME_TYPE.name());
warnSetting1.setMemo(getSandShipInfo(kObject));
warnSetting1.setWarnCalculator(SandMiningAreaConstant.TARGET_NO_OPERATING_HOURS_WARN_CALCULATOR);
warningSettingService.insertWarnSetting(warnSetting1);
......
......@@ -45,7 +45,7 @@ public class SalesRecordDaoImpl implements SalesRecordDao, SalesRecordConstant {
@Override
public List<Map<String, Object>> getAllSalesRecordByDate(String dateNow, String dateBefore) {
// TODO Auto-generated method stub
String sql = "select ss.project_id,ss.purchase_sand_company_id,ss.station_id,ss.dinas_type_id,sum(ss.deal_amount),sum(ss.amount) from xyst_dinas_sales_record ss where (ss.deal_time >= :startDate and ss.deal_time < :endDate ) GROUP BY ss.project_id,ss.purchase_sand_company_id,ss.station_id,ss.dinas_type_id";
String sql = "select ss.project_id,ss.purchase_sand_company_id,ss.station_id,ss.dinas_type_id,sum(ss.deal_amount),sum(ss.amount) from xyst_dinas_sales_record ss where (ss.deal_time >= :startDate and ss.deal_time < :endDate and customer_type != 'RetailInfo' ) GROUP BY ss.project_id,ss.purchase_sand_company_id,ss.station_id,ss.dinas_type_id";
return template.execute(new HibernateCallback<List<Map<String, Object>>>() {
@Override
public List<Map<String, Object>> doInHibernate(Session session) throws HibernateException {
......
......@@ -226,7 +226,16 @@
<type>string</type>
<description></description>
</field>
<field title='毛重'>
<name>grossWeight</name>
<type>fixnum</type>
<description></description>
</field>
<field title='皮重'>
<name>tareWeight</name>
<type>fixnum</type>
<description></description>
</field>
<field title='创建时间'>
<name>createTime</name>
<type>datetime</type>
......@@ -236,6 +245,37 @@
</ref>
<description></description>
</field>
<field title='毛重司磅员'>
<name>grossWeightPerson</name>
<type>string</type>
<description></description>
</field>
<field title='皮重司磅员'>
<name>tareWeightPerson</name>
<type>string</type>
<description></description>
</field>
<field title='毛重时间'>
<name>grossWeightTime</name>
<type>datetime</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='皮重时间'>
<name>tareWeightTime</name>
<type>datetime</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='修改时间'>
<name>modifyTime</name>
<type>datetime</type>
......
......@@ -103,6 +103,66 @@
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>grossWeightPerson</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>tareWeightPerson</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>grossWeight</m:name>
<m:title>毛重</m:title>
<m:type>fixnum</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>tareWeight</m:name>
<m:title>皮重</m:title>
<m:type>fixnum</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>grossWeightTime</m:name>
<m:title>毛重时间</m:title>
<m:type>datetime</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>tareWeightTime</m:name>
<m:title>皮重时间</m:title>
<m:type>datetime</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>contract.id</m:name>
<m:title>合同id</m:title>
<m:type>uuid</m:type>
......
......@@ -60,6 +60,9 @@ public class SalesSummaryServiceImpl implements SalesSummaryService {
KObject SalesSummary = SalesSummaryClass.newInstance();
SalesSummary.set(SalesSummaryConstants.ID, UUID.randomUUID());
SalesSummary.set(SalesSummaryConstants.PROJECT, projectFiledDao.load((UUID) mp.get("project_id")));
if(mp.containsKey("purchase_sand_company_id")&&mp.get("purchase_sand_company_id")!=null){
continue;
}
SalesSummary.set(SalesSummaryConstants.PURCHASESANDUNIT,purchaseSandCompanyDao.load((UUID) mp.get("purchase_sand_company_id")));
SalesSummary.set(SalesSummaryConstants.STATION, stationDao.load((UUID) mp.get("station_id")));
SalesSummary.set(SalesSummaryConstants.DINASTYPE, dinasTypeDao.load((UUID) mp.get("dinas_type_id")));
......
......@@ -53,11 +53,8 @@ public class SalesSummarySchedulerTask implements Task {
private JSONObject getConfig() {
sysConfigService = Amino.getApplicationContext().getBean(SysConfigService.class);
Optional<SysConfig> optional = sysConfigService.get("bill", "billAnalyseConfig");
if(optional.isPresent()){
return new JSONObject(optional.get().getValue().toString());
}
return null;
}
return optional.map(sysConfig -> new JSONObject(sysConfig.getValue().toString())).orElse(null);
}
public void generateSalesRecord(SalesSummaryService salesSummaryService) throws ParseException{
......
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