Browse Source

紧急处理批量更新单价更新对应发票价格信息

hejq 7 years ago
parent
commit
d2f7c2afa9

+ 8 - 8
pom.xml

@@ -382,7 +382,7 @@
         </resources>
         <!-- 在maven生命周期validate阶段生成timestamp -->
         <plugins>
-            <plugin>
+            <!--<plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>buildnumber-maven-plugin</artifactId>
                 <version>1.3</version>
@@ -402,7 +402,7 @@
                         </items>
                     </configuration>
                 </configuration>
-            </plugin>
+            </plugin>-->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
@@ -416,7 +416,7 @@
                 <artifactId>minify-maven-plugin</artifactId>
                 <version>1.7.4</version>
                 <!-- 静态文件压缩  -->
-                <executions>
+                <!--<executions>
                     <execution>
                         <id>default-minify</id>
                         <phase>prepare-package</phase>
@@ -449,9 +449,9 @@
                             <goal>minify</goal>
                         </goals>
                     </execution>
-                </executions>
+                </executions>-->
             </plugin>
-            <plugin>
+            <!--<plugin>
                 <artifactId>maven-resources-plugin</artifactId>
                 <executions>
                     <execution>
@@ -476,7 +476,7 @@
                 <groupId>com.uas.plugins</groupId>
                 <artifactId>static-maven-plugin</artifactId>
                 <version>0.0.2-SNAPSHOT</version>
-                <!-- 静态资源分离  -->
+                &lt;!&ndash; 静态资源分离  &ndash;&gt;
                 <executions>
                     <execution>
                         <id>default-static</id>
@@ -494,7 +494,7 @@
                                 <sourceInclude>resources/tpl/**/*.html</sourceInclude>
                                 <sourceInclude>WEB-INF/views/**/*.html</sourceInclude>
                             </sourceIncludes>
-                            <!--http://static.ubtob.com/css/index.css?_v=1450321871828-->
+                            &lt;!&ndash;http://static.ubtob.com/css/index.css?_v=1450321871828&ndash;&gt;
                             <versionSuffix>
                                 <suffix>?_v=${timestamp}</suffix>
                                 <exclude>*/require.js,*.min.js,*.min.css</exclude>
@@ -505,7 +505,7 @@
                         </goals>
                     </execution>
                 </executions>
-            </plugin>
+            </plugin>-->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-war-plugin</artifactId>

+ 2 - 1
src/main/java/com/uas/platform/b2b/erp/service/impl/APCheckServiceImpl.java

@@ -34,7 +34,8 @@ public class APCheckServiceImpl implements APCheckService {
 		if (!CollectionUtils.isEmpty(apChecks)) {
 			for (APCheck apCheck : apChecks) {
 				PurchaseApCheck apcheckb2b = purchaseAPCheckDao.findOne(apCheck.getAc_b2bid());
-				if (null != apcheckb2b) {// 客户UU正确,否则不保存
+				// 客户UU正确,否则不保存
+				if (null != apcheckb2b) {
 					apcheckb2b.setCheckStatus(apCheck.getAc_confirmstatus());
 					apcheckb2b.setCustreply(apCheck.getAc_reason());
 					apcheckb2b.setReason(apCheck.getAc_reason());

+ 1 - 1
src/main/java/com/uas/platform/b2b/service/impl/PurchaseApBillServiceImpl.java

@@ -182,7 +182,7 @@ public class PurchaseApBillServiceImpl implements PurchaseApBillService {
 					} else {
 						sql = sql + ", i.papi_taxamount = ROUND(i.papi_qty * " + prod.getPbu_orderprice() + "/(1 + (IFNULL(i.papi_taxrate, 0)/100)) * (IFNULL(i.papi_taxrate, 0)/100), 2)";
 					}
-					sql = sql +" where i.papi_papid = a.pab_id and i.papi_pdinoutno = 'ET18040001' and a.pad_enuu = 10041166 and i.papi_product = 23839348";
+					sql = sql +" where i.papi_papid = a.pab_id and i.papi_pdinoutno = '" + prod.getPbu_inoutno() + "' and a.pad_enuu = " + enuu + " and i.papi_product = " + prods.get(0).getId();
 					commonDao.getJdbcTemplate().update(sql);
 					logger.log("批量更新价格", "更新'" + prod.getPbu_inoutno() + "'发票明细价格", 1);
 					// 更新主表的税金合计

+ 2 - 2
src/main/resources/dev/jdbc.properties

@@ -1,7 +1,7 @@
 jdbc.driverClassName=com.mysql.jdbc.Driver
-jdbc.url=jdbc:mysql://192.168.253.12:3306/b2b_mysql_test?characterEncoding=UTF-8&allowMultiQueries=true&rewriteBatchedStatements=true
+jdbc.url=jdbc:mysql://10.10.100.18:3306/b2b_pre?characterEncoding=UTF-8&allowMultiQueries=true&rewriteBatchedStatements=true
 jdbc.username=root
-jdbc.password=select111***
+jdbc.password=select
 jdbc.initialSize=5
 jdbc.maxActive=100
 jdbc.minIdle=5

+ 28 - 46
src/test/java/com/uas/platform/b2b/purc/PurchaseNotify.java

@@ -1,28 +1,16 @@
 package com.uas.platform.b2b.purc;
 
-import com.alibaba.fastjson.JSONObject;
 import com.uas.platform.b2b.BaseJunitTest;
 import com.uas.platform.b2b.dao.PurchaseNoticeDao;
+import com.uas.platform.b2b.dao.PurchaseNoticeEndDao;
 import com.uas.platform.b2b.dao.PurchaseOrderItemDao;
 import com.uas.platform.b2b.model.PurchaseNotice;
+import com.uas.platform.b2b.model.PurchaseNoticeEnd;
 import com.uas.platform.b2b.model.PurchaseOrderItem;
-import org.apache.commons.collections.map.HashedMap;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.http.util.EntityUtils;
+import com.uas.platform.core.model.Constant;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.LinkedMultiValueMap;
-import org.springframework.util.MultiValueMap;
-import org.springframework.web.client.RestTemplate;
 
 import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
@@ -139,37 +127,31 @@ public class PurchaseNotify extends BaseJunitTest {
     }
 
     @Autowired
-    private RestTemplate restTemplate;
-    @Test
-    public void testHttp() {
-        HttpHeaders headers = new HttpHeaders();
-        headers.setContentType(MediaType.APPLICATION_JSON);
-        MultiValueMap<String, String> map= new LinkedMultiValueMap<>();
-        map.add("code", "XIH1G4");
-        map.add("appSecret", "8a9d398c70f842309472a69bc730038d");
-        map.add("appId", "a9f624cbbdb947049f5638880b0ecbb2");
-        HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(map, headers);
-        ResponseEntity<String> response = restTemplate.postForEntity( "https://opengwtest.bgycc.com/open/oauth/token", request, String.class );
-        System.out.println(response);
-    }
-
-    public static void main(String[] args) throws Exception {
-        Map<String, String> map = new HashedMap();
-        map.put("code", "XIH1G4");
-        map.put("appSecret", "8a9d398c70f842309472a69bc730038d");
-        map.put("appId", "a9f624cbbdb947049f5638880b0ecbb2");
-        String res = doPost("https://opengwtest.bgycc.com/open/oauth/token", JSONObject.toJSONString(map));
-        System.out.println(res);
-    }
+    private PurchaseNoticeEndDao noticeEndDao;
 
-    public static String doPost(String postUrl, String formData) throws Exception {
-        HttpClient httpClient = new DefaultHttpClient();
-        HttpPost post = new HttpPost(postUrl);
-        StringEntity postingString = new StringEntity(formData, "UTF-8");
-        post.setEntity(postingString);
-        post.setHeader("Content-type", MediaType.APPLICATION_JSON.toString());
-        HttpResponse response = httpClient.execute(post);
-        String content = EntityUtils.toString(response.getEntity());
-        return content;
+    @Test
+    public void findNoticeTime() {
+        Long[] ids = {33809L,33810L,33825L,33826L,33827L,33845L,33965L,34045L,34046L,34072L,34073L,34076L,34077L,34078L,34125L,34145L,34146L,34326L,34327L,34328L,34329L,34330L,34331L,34332L,34333L,34334L,34335L,34336L,34337L,34338L,34339L,34340L,34341L,34343L,34347L,34348L,34349L,34350L,34351L,34352L,34353L,34354L,34355L,34356L,34359L,34606L,34607L,34608L,34609L,34610L,34611L,34612L,34613L,34614L,34618L,34619L,34620L,34621L,34622L,34623L,34624L,34965L,35087L,35117L,35129L,35134L,35149L,35153L,35154L,35199L,35225L,35227L,35231L,35235L,35237L,35244L,35273L,35293L,35305L,35313L,35335L,35338L,35368L,35369L,35401L,35402L,35419L,35436L,35460L,35465L,35520L,35528L,35566L,35577L,35607L,35608L,35642L,35644L,35647L,35680L,35693L,35786L,35790L,35809L,35824L,35866L,35926L,35941L,35942L,35943L,35944L,35945L,35946L,35947L,35948L,35949L,35950L,35951L,35952L,35953L,35954L,35955L,35956L,35957L,35958L,35985L,35986L,36005L,36065L,36108L,36110L,36126L,36140L,36152L,36157L,36158L,36173L,36176L,36204L,36239L,36246L,36250L,36254L,36256L,36263L,36322L,36330L,36338L,36353L,36356L,36363L,36386L,36387L,36407L,36420L,36437L,36483L,36538L,36546L,36552L,36566L,36568L,36588L,36599L,36625L,36630L,36631L,36649L,36667L,36669L,36672L,36707L,36720L,36783L,36815L,36819L,36820L,36853L,36871L,36898L,37046L,37047L,37085L,37086L,37087L,37088L,37089L,37090L,37091L,37092L,37093L,37094L,37105L,37106L,37107L,37109L,37110L,37111L,37147L,37148L};
+        List<Long> idList = Arrays.asList(ids);
+        Long enUU = 10041166L;
+        Long startTime = System.currentTimeMillis();
+        System.out.println("startTime-> " + startTime);
+        List<PurchaseNoticeEnd> noticeList = noticeEndDao.findByEnUUAndSourceIdList(enUU, idList);
+        for (PurchaseNoticeEnd notice : noticeList) {
+            notice.setErpDate(new Date(System.currentTimeMillis()));
+            notice.setEnd(Constant.YES);
+        }
+        noticeEndDao.save(noticeList);
+        Long endTime = System.currentTimeMillis();
+        System.out.println("endTime-> " + endTime);
+        System.out.println("cost-> " + (endTime - startTime));
+
+        // 推送结案送回提醒给采购单供应商联系人
+       /* Long vendUserUU = notice.getOrderItem().getOrder().getVendUserUU();
+        if (vendUserUU != null) {
+            UserBaseInfo user = userBaseInfoDao.findOne(vendUserUU);
+            XingePusher.pushByUser(user, "客户取消了送货提醒", "物料:" + notice.getOrderItem().getProduct().getTitle(), "",
+                    "");
+        }*/
     }
 }